本文整理了Java中org.hibernate.annotations.Cache.<init>()
方法的一些代码示例,展示了Cache.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cache.<init>()
方法的具体详情如下:
包路径:org.hibernate.annotations.Cache
类名称:Cache
方法名:<init>
暂无
代码示例来源:origin: Raysmond/SpringBlog
/**
* A generic setting model
*
* @author Raysmond
*/
@Entity
@Table(name = "settings")
@Getter
@Setter
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "settingCache")
public class Setting extends BaseModel {
@Column(name = "_key", unique = true, nullable = false)
private String key;
@Lob
@Column(name = "_value")
private Serializable value;
}
代码示例来源:origin: Raysmond/SpringBlog
/**
* @author Raysmond
*/
@Entity
@Table(name = "tags")
@Getter
@Setter
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "tagCache")
public class Tag extends BaseModel {
@Column(nullable = false, unique = true)
private String name;
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "tags")
private List<Post> posts = new ArrayList<>();
public Tag() {
}
public Tag(String name) {
this.setName(name);
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity
@Cache(usage = CacheConcurrencyStrategy.NONE)
public static class SimpleEntity extends AbstractMappedSuperclassWithGenericReturnValue<SimpleEntity.Type> {
public enum Type implements Marker {
ONE
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity( name="StateCodes" )
@Cache( region="com.acme.referenceData", usage = CacheConcurrencyStrategy.READ_WRITE )
public static class StateCodes {
@Id
public Integer id;
public StateCodes() {
}
public StateCodes(Integer id) {
this.id = id;
}
}
代码示例来源:origin: BroadleafCommerce/BroadleafCommerce
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region="blStandardElements")
public class SearchInterceptImpl implements SearchIntercept {
@Id
@GeneratedValue(generator = "SearchInterceptId")
@GenericGenerator(
@Column(name = "SEARCH_INTERCEPT_ID")
protected Long id;
@Column(name = "TERM")
@Index(name="SEARCHINTERCEPT_TERM_INDEX", columnNames={"TERM"})
private String term;
@Column(name = "REDIRECT")
private String redirect;
代码示例来源:origin: hibernate/hibernate-orm
@MappedSuperclass
@Cache(usage = CacheConcurrencyStrategy.NONE)
public static class AbstractMappedSuperclassWithGenericReturnValue<T extends Marker> {
@Id
@GeneratedValue
public int id;
@Access(AccessType.PROPERTY)
private T entity;
public T getEntity() {
return entity;
}
public void setEntity(T entity) {
this.entity = entity;
}
}
代码示例来源:origin: BroadleafCommerce/BroadleafCommerce
/**
*
* @author jfischer
*
*/
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "BLC_DYN_DISCRETE_ORDER_ITEM")
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region="blOrderElements")
@AdminPresentationClass(friendlyName = "DynamicPriceDiscreteOrderItemImpl_dynamicPriceOrderItem")
public class DynamicPriceDiscreteOrderItemImpl extends DiscreteOrderItemImpl implements DynamicPriceDiscreteOrderItem {
private static final long serialVersionUID = 1L;
@Override
public void setSku(Sku sku) {
this.sku = sku;
this.name = sku.getName();
}
@Override
public boolean updateSaleAndRetailPrices() {
return false;
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity( name = "ZipCodes" )
@Cache( region="com.acme.referenceData", usage = CacheConcurrencyStrategy.READ_WRITE )
public static class ZipCodes {
@Id
public Integer id;
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity(name = "FileClob")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, include = "non-lazy")
public static class FileClob {
private int id;
private Clob clob;
@Id
@GeneratedValue
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Column(name = "filedata", length = 1024 * 1024)
@Lob
@Basic(fetch = FetchType.LAZY)
public Clob getClob() {
return clob;
}
public void setClob(Clob clob) {
this.clob = clob;
}
}
代码示例来源:origin: Raysmond/SpringBlog
@Entity
@Table(name = "users")
@Getter
@Setter
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "userCache")
public class User extends BaseModel {
public static final String ROLE_ADMIN = "ROLE_ADMIN";
代码示例来源:origin: hibernate/hibernate-orm
@Entity
@Table( name = "BAR" )
private static class Bar {
@Id
@GeneratedValue
Long id;
@ManyToOne
@Cache( usage = CacheConcurrencyStrategy.READ_WRITE )
Foo foo;
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity(name = "Event")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public static class Event {
@Id
@GeneratedValue
private Long id;
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity(name = "FileBlob")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, include = "non-lazy")
public static class FileBlob {
private int id;
private Blob blob;
@Id
@GeneratedValue
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Column(name = "filedata", length = 1024 * 1024)
@Lob
@Basic(fetch = FetchType.LAZY)
public Blob getBlob() {
return blob;
}
public void setBlob(Blob blob) {
this.blob = blob;
}
}
代码示例来源:origin: Raysmond/SpringBlog
@Entity
@Table(name = "posts")
@Getter
@Setter
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "postCache")
public class Post extends BaseModel {
private static final SimpleDateFormat SLUG_DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd");
inverseJoinColumns = {@JoinColumn(name = "tag_id", nullable = false, updatable = false)}
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "tagCache")
private Set<Tag> tags = new HashSet<>();
代码示例来源:origin: hibernate/hibernate-orm
@Entity
@Table(name = "people_group")
@Cacheable
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public static class People {
@Id
@GeneratedValue
private Integer id;
@OneToMany(cascade = CascadeType.ALL)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
private List<Person> people = new ArrayList<Person>();
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity(name = "Person")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public static class Person {
@Id
private Long id;
private String name;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity(name = "FileNClob")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, include = "non-lazy")
public static class FileNClob {
private int id;
private NClob clob;
@Id
@GeneratedValue
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Column(name = "filedata", length = 1024 * 1024)
@Lob
@Basic(fetch = FetchType.LAZY)
public NClob getClob() {
return clob;
}
public void setClob(NClob clob) {
this.clob = clob;
}
}
}
代码示例来源:origin: BroadleafCommerce/BroadleafCommerce
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "BLC_FULFILLMENT_OPT_BANDED_PRC")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "blStandardElements")
@AdminPresentationClass(friendlyName = "Banded Price Fulfillment Option")
public class BandedPriceFulfillmentOptionImpl extends FulfillmentOptionImpl implements BandedPriceFulfillmentOption {
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region="blStandardElements")
@AdminPresentationCollection(friendlyName = "BandedPriceFulfillmentOptionBands", excluded = true)
protected List<FulfillmentPriceBand> bands = new ArrayList<FulfillmentPriceBand>();
代码示例来源:origin: hibernate/hibernate-orm
@Entity(name = "NoCacheConcurrencyStrategy")
@Cache(usage = CacheConcurrencyStrategy.NONE)
public static class NoCacheConcurrencyStrategyEntity {
@Id
@GeneratedValue
private Integer id;
private String name;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity(name = "CacheableItem")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "item")
public static class CacheableItem {
private Long id;
内容来源于网络,如有侵权,请联系作者删除!