unit test for: update ManyToMany collection cache on updating cached beans

This commit is contained in:
Wolfgang Buchner
2014-04-23 21:19:06 +12:00
committed by Rob Bygrave
parent a7df7da984
commit 2dccb818a2
2 changed files with 110 additions and 3 deletions
@@ -0,0 +1,42 @@
package com.avaje.tests.model.basic;
import com.avaje.ebean.annotation.CacheStrategy;
import com.avaje.ebean.annotation.CacheTuning;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import java.util.ArrayList;
import java.util.List;
/**
* Cached bean for testing caching implementation.
*/
@CacheStrategy
@Entity
@Table(name = "o_cached_bean")
public class CachedBean {
@Id
Long id;
@ManyToMany
List<Country> countries = new ArrayList<Country>();
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public List<Country> getCountries() {
return countries;
}
public void setCountries(List<Country> countries) {
this.countries = countries;
}
}