Codota Logo
Cache
Code IndexAdd Codota to your IDE (free)

How to use
Cache
in
org.hibernate.annotations

Best Java code snippets using org.hibernate.annotations.Cache (Showing top 20 results out of 918)

Refine searchRefine arrow

  • Table
  • Entity
  • Column
  • Id
  • Inheritance
  • GeneratedValue
  • Common ways to obtain Cache
private void myMethod () {
Cache c =
  • Codota IconXClass xClass;xClass.getAnnotation(Cache.class)
  • Codota IconXProperty xProperty;xProperty.getAnnotation(Cache.class)
  • Smart code suggestions by Codota
}
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: hibernate/hibernate-orm

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;
  }
}
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: hibernate/hibernate-orm

  @Entity
  @Cache(usage = CacheConcurrencyStrategy.NONE)
  public static class SimpleEntity extends AbstractMappedSuperclassWithGenericReturnValue<SimpleEntity.Type> {

    public enum Type implements Marker {
      ONE
    }
  }
}
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

@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

/**
 * 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>();

}

origin: hibernate/hibernate-orm

  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;
origin: BroadleafCommerce/BroadleafCommerce

  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));
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 = "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 = "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: BroadleafCommerce/BroadleafCommerce

/**
 * This class is meant as a template to provide overriding of the annotations on fields in 
 * <code>org.broadleafcommerce.core.order.fulfillment.domain.BandedWeightFulfillmentOptionImpl</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.
 * 
 * See 
 * 
 * @author Kelly Tisdell
 *
 */
@Deprecated
public abstract class OptionalEnterpriseBandedWeightFulfillmentOptionTemplate {

  @OneToMany(mappedBy = "option", targetEntity = FulfillmentWeightBandImpl.class)
  @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "blStandardElements")
  @AdminPresentationCollection(friendlyName = "BandedWeightFulfillmentOptionBands", excluded = true)
  protected List<FulfillmentWeightBand> bands = new ArrayList<FulfillmentWeightBand>();

}

origin: org.hibernate/hibernate-annotations

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;
  }
}
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 = "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 = "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: org.hibernate/hibernate-annotations

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;
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

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;
  }
}

origin: hibernate/hibernate-orm

@Entity
@Table( name = "BAR" )
private static class Bar {
  @Id
  @GeneratedValue
  Long id;
  @ManyToOne
  @Cache( usage = CacheConcurrencyStrategy.READ_WRITE )
  Foo foo;
}
org.hibernate.annotationsCache

Most used methods

  • <init>
  • region
  • usage
  • include

Popular in Java

  • Making http requests using okhttp
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • getContentResolver (Context)
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now