Refine search
/** * 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; }
public void setCache(Cache cacheAnn) { if ( cacheAnn != null ) { cacheRegionName = BinderHelper.isEmptyAnnotationValue( cacheAnn.region() ) ? null : cacheAnn.region(); cacheConcurrencyStrategy = EntityBinder.getCacheConcurrencyStrategy( cacheAnn.usage() ); } else { cacheConcurrencyStrategy = null; cacheRegionName = null; } }
/** * @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); } }
@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; } }
/** * This class is meant as a template to provide overriding of the annotations on fields in * <code>org.broadleafcommerce.core.order.fulfillment.domain.BandedPriceFulfillmentOptionImpl</code>. This provides a * stop gap measure to allow someone to weave in the appropriate annotations in 4.0.x without forcing a schema change on those * who prefer not to use it. This should likely be removed in 4.1 for fixed annotations on the entity itself. * * @author Kelly Tisdell * */ @Deprecated public abstract class OptionalEnterpriseBandedPriceFulfillmentOptionTemplate { @OneToMany(mappedBy = "option", targetEntity = FulfillmentPriceBandImpl.class) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "blStandardElements") @AdminPresentationCollection(friendlyName = "BandedPriceFulfillmentOptionBands", excluded = true) protected List<FulfillmentPriceBand> bands = new ArrayList<FulfillmentPriceBand>(); }
cacheConcurrentStrategy = resolveCacheConcurrencyStrategy( effectiveCacheAnn.usage() ); cacheRegion = effectiveCacheAnn.region(); switch ( effectiveCacheAnn.include().toLowerCase( Locale.ROOT ) ) { case "all": { cacheLazyProperty = true; "Unknown @Cache.include value [" + effectiveCacheAnn.include() + "] : " + annotatedClass.getName() ); if ( naturalIdCacheAnn != null ) { if ( BinderHelper.isEmptyAnnotationValue( naturalIdCacheAnn.region() ) ) { if ( explicitCacheAnn != null && StringHelper.isNotEmpty( explicitCacheAnn.region() ) ) { naturalIdCacheRegion = explicitCacheAnn.region() + NATURAL_ID_CACHE_SUFFIX;
LOG.info("Cache invalidation event to be sent"); LOG.info("superclazz : " + superclazz.getName()); LOG.info("region : " + cacheAnnotation.region()); LOG.info("id : " + id); detailMap.put("CACHE_REGION", new BroadleafSystemEventDetail("Cache Region", cacheAnnotation.region())); detailMap.put("ENTITY_TYPE", new BroadleafSystemEventDetail("Entity Type", superclazz.getName())); detailMap.put("IDENTIFIER", new BroadleafSystemEventDetail("Identifier", id));
@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; } }
public void setCache(Cache cacheAnn) { if ( cacheAnn != null ) { cacheRegion = BinderHelper.isDefault( cacheAnn.region() ) ? null : cacheAnn.region(); cacheConcurrentStrategy = getCacheConcurrencyStrategy( cacheAnn.usage() ); if ( "all".equalsIgnoreCase( cacheAnn.include() ) ) { cacheLazyProperty = true; } else if ( "non-lazy".equalsIgnoreCase( cacheAnn.include() ) ) { cacheLazyProperty = false; } else { throw new AnnotationException( "Unknown lazy property annotations: " + cacheAnn.include() ); } } else { cacheConcurrentStrategy = null; cacheRegion = null; cacheLazyProperty = true; } }
/** * * @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; } }
@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; } } }
@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; } }
public void setCache(Cache cacheAnn) { if ( cacheAnn != null ) { cacheRegionName = BinderHelper.isDefault( cacheAnn.region() ) ? null : cacheAnn.region(); cacheConcurrencyStrategy = EntityBinder.getCacheConcurrencyStrategy( cacheAnn.usage() ); } else { cacheConcurrencyStrategy = null; cacheRegionName = null; } }
public void setCache(Cache cacheAnn) { if ( cacheAnn != null ) { cacheRegion = BinderHelper.isEmptyAnnotationValue( cacheAnn.region() ) ? null : cacheAnn.region(); cacheConcurrentStrategy = getCacheConcurrencyStrategy( cacheAnn.usage() ); if ( "all".equalsIgnoreCase( cacheAnn.include() ) ) { cacheLazyProperty = true; } else if ( "non-lazy".equalsIgnoreCase( cacheAnn.include() ) ) { cacheLazyProperty = false; } else { throw new AnnotationException( "Unknown lazy property annotations: " + cacheAnn.include() ); } } else { cacheConcurrentStrategy = null; cacheRegion = null; cacheLazyProperty = true; } }
@Entity(name = "Event") @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public static class Event { @Id @GeneratedValue private Long id; }