protected boolean reassociateIfUninitializedProxy(Object object, SessionImplementor source) { if ( !Hibernate.isInitialized(object) ) { throw new PersistentObjectException("uninitialized proxy passed to save()"); } else { return false; } }
@Override public Object unproxy(Object maybeProxy) throws HibernateException { if ( maybeProxy instanceof HibernateProxy ) { final HibernateProxy proxy = (HibernateProxy) maybeProxy; final LazyInitializer li = proxy.getHibernateLazyInitializer(); if ( li.isUninitialized() ) { throw new PersistentObjectException( "object was an uninitialized proxy for " + li.getEntityName() ); } //unwrap the object and return return li.getImplementation(); } else { return maybeProxy; } }
throw new PersistentObjectException( "uninitialized proxy passed to persist()" ); throw new PersistentObjectException( "detached entity passed to persist: " + getLoggableName( event.getEntityName(), entity )
throw new PersistentObjectException( "object passed to save() was already persistent: " + MessageHelper.infoString( entityEntry.getPersister(), requestedId, factory )
throw new PersistentObjectException( "attempted to load into an instance that was already associated with the session: " + MessageHelper.infoString(
throw new PersistentObjectException( "attempted to refresh transient instance when persistent instance was already associated with the Session: " + MessageHelper.infoString( persister, id, source.getFactory() )
protected boolean reassociateIfUninitializedProxy(Object object, SessionImplementor source) { if ( !Hibernate.isInitialized(object) ) { throw new PersistentObjectException("uninitialized proxy passed to save()"); } else { return false; } }
protected boolean reassociateIfUninitializedProxy(Object object, SessionImplementor source) { if ( !Hibernate.isInitialized(object) ) { throw new PersistentObjectException("uninitialized proxy passed to save()"); } else { return false; } }
protected boolean reassociateIfUninitializedProxy(Object object, SessionImplementor source) { if ( !Hibernate.isInitialized(object) ) { throw new PersistentObjectException("uninitialized proxy passed to save()"); } else { return false; } }
protected boolean reassociateIfUninitializedProxy(Object object, SessionImplementor source) { if ( !Hibernate.isInitialized(object) ) { throw new PersistentObjectException("uninitialized proxy passed to save()"); } else { return false; } }
protected boolean reassociateIfUninitializedProxy(Object object, SessionImplementor source) { if ( !Hibernate.isInitialized(object) ) { throw new PersistentObjectException("uninitialized proxy passed to save()"); } else { return false; } }
@Override public Object unproxy(Object maybeProxy) throws HibernateException { if ( maybeProxy instanceof HibernateProxy ) { final HibernateProxy proxy = (HibernateProxy) maybeProxy; final LazyInitializer li = proxy.getHibernateLazyInitializer(); if ( li.isUninitialized() ) { throw new PersistentObjectException( "object was an uninitialized proxy for " + li.getEntityName() ); } //unwrap the object and return return li.getImplementation(); } else { return maybeProxy; } }
/** * Get the entity instance underlying the given proxy, throwing * an exception if the proxy is uninitialized. If the given object * is not a proxy, simply return the argument. */ public Object unproxy(Object maybeProxy) throws HibernateException { if ( maybeProxy instanceof ElementWrapper ) { maybeProxy = ( (ElementWrapper) maybeProxy ).getElement(); } if ( maybeProxy instanceof HibernateProxy ) { HibernateProxy proxy = (HibernateProxy) maybeProxy; LazyInitializer li = proxy.getHibernateLazyInitializer(); if ( li.isUninitialized() ) { throw new PersistentObjectException( "object was an uninitialized proxy for " + li.getEntityName() ); } return li.getImplementation(); //unwrap the object } else { return maybeProxy; } }
/** * Get the entity instance underlying the given proxy, throwing * an exception if the proxy is uninitialized. If the given object * is not a proxy, simply return the argument. */ public Object unproxy(Object maybeProxy) throws HibernateException { if ( maybeProxy instanceof ElementWrapper ) { maybeProxy = ( (ElementWrapper) maybeProxy ).getElement(); } if ( maybeProxy instanceof HibernateProxy ) { HibernateProxy proxy = (HibernateProxy) maybeProxy; LazyInitializer li = proxy.getHibernateLazyInitializer(); if ( li.isUninitialized() ) { throw new PersistentObjectException( "object was an uninitialized proxy for " + li.getEntityName() ); } return li.getImplementation(); //unwrap the object } else { return maybeProxy; } }
/** * Get the entity instance underlying the given proxy, throwing * an exception if the proxy is uninitialized. If the given object * is not a proxy, simply return the argument. */ @Override public Object unproxy(Object maybeProxy) throws HibernateException { if ( maybeProxy instanceof ElementWrapper ) { maybeProxy = ( (ElementWrapper) maybeProxy ).getElement(); } if ( maybeProxy instanceof HibernateProxy ) { HibernateProxy proxy = (HibernateProxy) maybeProxy; LazyInitializer li = proxy.getHibernateLazyInitializer(); if ( li.isUninitialized() ) { throw new PersistentObjectException( "object was an uninitialized proxy for " + li.getEntityName() ); } return li.getImplementation(); //unwrap the object } else { return maybeProxy; } }
/** * Get the entity instance underlying the given proxy, throwing * an exception if the proxy is uninitialized. If the given object * is not a proxy, simply return the argument. */ @Override public Object unproxy(Object maybeProxy) throws HibernateException { if ( maybeProxy instanceof ElementWrapper ) { maybeProxy = ( (ElementWrapper) maybeProxy ).getElement(); } if ( maybeProxy instanceof HibernateProxy ) { HibernateProxy proxy = (HibernateProxy) maybeProxy; LazyInitializer li = proxy.getHibernateLazyInitializer(); if ( li.isUninitialized() ) { throw new PersistentObjectException( "object was an uninitialized proxy for " + li.getEntityName() ); } return li.getImplementation(); //unwrap the object } else { return maybeProxy; } }
throw new PersistentObjectException( "object passed to save() was already persistent: " + MessageHelper.infoString( entityEntry.getPersister(), requestedId, factory )
throw new PersistentObjectException( "object passed to save() was already persistent: " + MessageHelper.infoString( entityEntry.getPersister(), requestedId, factory )
throw new PersistentObjectException("uninitialized proxy passed to persist()"); throw new PersistentObjectException( "detached entity passed to persist: " + event.getEntityName() ); case PERSISTENT: entityIsPersistent(event, createCache);
throw new PersistentObjectException("uninitialized proxy passed to persist()"); throw new PersistentObjectException( "detached entity passed to persist: " + getLoggableName( event.getEntityName(), entity )