Package org.hibernate

Examples of org.hibernate.PersistentObjectException


    try {
      hibernateTemplate.execute(new HibernateCallback<Object>() {
        @Override
        public Object doInHibernate(org.hibernate.Session session) throws HibernateException {
          throw new PersistentObjectException("");
        }
      });
      fail("Should have thrown InvalidDataAccessApiUsageException");
    }
    catch (InvalidDataAccessApiUsageException ex) {
View Full Code Here


    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
View Full Code Here

    final EntityKey keyToLoad,
    final LoadEventListener.LoadType options) {

    if ( event.getInstanceToLoad() != null ) {
      if ( event.getSession().getPersistenceContext().getEntry( event.getInstanceToLoad() ) != null ) {
        throw new PersistentObjectException(
            "attempted to load into an instance that was already associated with the session: " +
            MessageHelper.infoString( persister, event.getEntityId(), event.getSession().getFactory() )
          );
      }
      persister.setIdentifier( event.getInstanceToLoad(), event.getEntityId(), event.getSession() );
View Full Code Here

        final boolean isEqual = !entityEntry.getPersister().getIdentifierType()
            .isEqual( requestedId, entityEntry.getId(), factory );

        if ( isEqual ) {
          throw new PersistentObjectException(
              "object passed to save() was already persistent: " +
                  MessageHelper.infoString( entityEntry.getPersister(), requestedId, factory )
          );
        }
View Full Code Here

   
    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
View Full Code Here

   
    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
View Full Code Here

    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
View Full Code Here

    final EntityKey keyToLoad,
    final LoadEventListener.LoadType options) {

    if ( event.getInstanceToLoad() != null ) {
      if ( event.getSession().getPersistenceContext().getEntry( event.getInstanceToLoad() ) != null ) {
        throw new PersistentObjectException(
            "attempted to load into an instance that was already associated with the session: " +
            MessageHelper.infoString( persister, event.getEntityId(), event.getSession().getFactory() )
          );
      }
      persister.setIdentifier( event.getInstanceToLoad(), event.getEntityId(), event.getSession() );
View Full Code Here

   
    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
View Full Code Here

   
    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
View Full Code Here

TOP

Related Classes of org.hibernate.PersistentObjectException

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.