Package org.hibernate

Examples of org.hibernate.CacheMode


      EntityPersister persister,
      Object entity,
      EntityEntry entityEntry,
      Set transientEntities) throws HibernateException {

    CacheMode cacheMode = session.getCacheMode();
    session.setCacheMode( CacheMode.GET );
    session.getPersistenceContext().incrementCascadeLevel();
    try {
      // cascade-delete to collections BEFORE the collection owner is deleted
      new Cascade( CascadingAction.DELETE, Cascade.AFTER_INSERT_BEFORE_DELETE, session )
View Full Code Here


      EventSource session,
      EntityPersister persister,
      Object entity,
      Set transientEntities) throws HibernateException {

    CacheMode cacheMode = session.getCacheMode();
    session.setCacheMode( CacheMode.GET );
    session.getPersistenceContext().incrementCascadeLevel();
    try {
      // cascade-delete to many-to-one AFTER the parent was deleted
      new Cascade( CascadingAction.DELETE, Cascade.BEFORE_INSERT_AFTER_DELETE, session )
View Full Code Here

  @Override
  public <A> A find(Class<A> entityClass, Object primaryKey, LockModeType lockModeType, Map<String, Object> properties) {
    checkOpen();
    Session session = internalGetSession();
    CacheMode previousCacheMode = session.getCacheMode();
    CacheMode cacheMode = determineAppropriateLocalCacheMode( properties );
    LockOptions lockOptions = null;
    try {
      session.setCacheMode( cacheMode );
      if ( lockModeType != null ) {
        lockOptions = getLockRequest( lockModeType, properties );
View Full Code Here

  public void refresh(Object entity, LockModeType lockModeType, Map<String, Object> properties) {
    checkOpen();
    checkTransactionNeeded();

    Session session = internalGetSession();
    CacheMode previousCacheMode = session.getCacheMode();
    CacheMode localCacheMode = determineAppropriateLocalCacheMode( properties );
    LockOptions lockOptions = null;
    try {
      session.setCacheMode( localCacheMode );
      if ( !session.contains( entity ) ) {
        throw new IllegalArgumentException( "Entity not managed" );
View Full Code Here

      EntityPersister persister,
      Object entity,
      EntityEntry entityEntry,
      Set transientEntities) throws HibernateException {

    CacheMode cacheMode = session.getCacheMode();
    session.setCacheMode( CacheMode.GET );
    session.getPersistenceContext().incrementCascadeLevel();
    try {
      // cascade-delete to collections BEFORE the collection owner is deleted
      new Cascade( CascadingActions.DELETE, CascadePoint.AFTER_INSERT_BEFORE_DELETE, session ).cascade(
View Full Code Here

      EventSource session,
      EntityPersister persister,
      Object entity,
      Set transientEntities) throws HibernateException {

    CacheMode cacheMode = session.getCacheMode();
    session.setCacheMode( CacheMode.GET );
    session.getPersistenceContext().incrementCascadeLevel();
    try {
      // cascade-delete to many-to-one AFTER the parent was deleted
      new Cascade( CascadingActions.DELETE, CascadePoint.BEFORE_INSERT_AFTER_DELETE, session ).cascade(
View Full Code Here

  public <A> A find(Class<A> entityClass, Object primaryKey, LockModeType lockModeType) {
    return find( entityClass, primaryKey, lockModeType, null );
  }

  public <A> A find(Class<A> entityClass, Object primaryKey, LockModeType lockModeType, Map<String, Object> properties) {
    CacheMode previousCacheMode = getSession().getCacheMode();
    CacheMode cacheMode = determineAppropriateLocalCacheMode( properties );
    LockOptions lockOptions = null;
    try {
      getSession().setCacheMode( cacheMode );
      if ( lockModeType != null ) {
        return ( A ) getSession().get(
View Full Code Here

    refresh( entity, lockModeType, null );
  }

  public void refresh(Object entity, LockModeType lockModeType, Map<String, Object> properties) {
    checkTransactionNeeded();
    CacheMode previousCacheMode = getSession().getCacheMode();
    CacheMode localCacheMode = determineAppropriateLocalCacheMode( properties );
    LockOptions lockOptions = null;
    try {
      getSession().setCacheMode( localCacheMode );
      if ( !getSession().contains( entity ) ) {
        throw new IllegalArgumentException( "Entity not managed" );
View Full Code Here

  public <A> A find(Class<A> entityClass, Object primaryKey, LockModeType lockModeType) {
    return find( entityClass, primaryKey, lockModeType, null );
  }

  public <A> A find(Class<A> entityClass, Object primaryKey, LockModeType lockModeType, Map<String, Object> properties) {
    CacheMode previousCacheMode = getSession().getCacheMode();
    CacheMode cacheMode = determineAppropriateLocalCacheMode( properties );
    LockOptions lockOptions = null;
    try {
      getSession().setCacheMode( cacheMode );
      if ( lockModeType != null ) {
        lockOptions = getLockRequest( lockModeType, properties );
View Full Code Here

    refresh( entity, lockModeType, null );
  }

  public void refresh(Object entity, LockModeType lockModeType, Map<String, Object> properties) {
    checkTransactionNeeded();
    CacheMode previousCacheMode = getSession().getCacheMode();
    CacheMode localCacheMode = determineAppropriateLocalCacheMode( properties );
    LockOptions lockOptions = null;
    try {
      getSession().setCacheMode( localCacheMode );
      if ( !getSession().contains( entity ) ) {
        throw new IllegalArgumentException( "Entity not managed" );
View Full Code Here

TOP

Related Classes of org.hibernate.CacheMode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.