@Entity
@Immutable
@Table
@NamedQueries({
@NamedQuery(name="country.getByCountryCode", query="select c from Country c where c.countryCode = :countryCode")
})
@FetchProfiles({
@FetchProfile(name = FetchProfileName.OFFER_DETAIL, fetchOverrides = {
@FetchProfile.FetchOverride(entity = Country.class, association = "defaultLanguage", mode = FetchMode.JOIN)
})
})
@NaturalIdCache(region=CacheRegion.NATURAL)
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE,region=CacheRegion.COUNTRY)
public class Country implements Serializable, GeoLocation, Comparable<Country>, URLLocation{
private Long id;
private String name, countryCode;
private Language defaultLanguage;
@ManyToOne(fetch=FetchType.EAGER, optional=false)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE,region=CacheRegion.NEVERCHANGE)
@JoinColumn(name="FK_LanguageID", nullable=false)
@Fetch(FetchMode.SELECT)
@JsonIgnore
public Language getDefaultLanguage() {
return defaultLanguage;
}
[...]
}