Package org.hibernate

Examples of org.hibernate.WrongClassException


      final Object object,
      final LockMode requestedLockMode,
      final SessionImplementor session)
      throws HibernateException, SQLException {
    if ( !persister.isInstance( object ) ) {
      throw new WrongClassException(
          "loaded object was of wrong class " + object.getClass(),
          key.getIdentifier(),
          persister.getEntityName()
      );
    }
View Full Code Here


      final String result = persister.getSubclassForDiscriminatorValue( discriminatorValue );

      if ( result == null ) {
        //woops we got an instance of another class hierarchy branch
        throw new WrongClassException(
            "Discriminator: " + discriminatorValue,
            id,
            persister.getEntityName()
          );
      }
View Full Code Here

    // see if we have an existing entry in the session for this EntityKey
    final Object existing = context.getSession().getEntityUsingInterceptor( entityKey );
    if ( existing != null ) {
      // It is previously associated with the Session, perform some checks
      if ( ! entityReference.getEntityPersister().isInstance( existing ) ) {
        throw new WrongClassException(
            "loaded object was of wrong class " + existing.getClass(),
            entityKey.getIdentifier(),
            entityReference.getEntityPersister().getEntityName()
        );
      }
View Full Code Here

    final String result = loadable.getSubclassForDiscriminatorValue( discriminatorValue );

    if ( result == null ) {
      // whoops! we got an instance of another class hierarchy branch
      throw new WrongClassException(
          "Discriminator: " + discriminatorValue,
          entityKey.getIdentifier(),
          entityReference.getEntityPersister().getEntityName()
      );
    }
View Full Code Here

    // see if we have an existing entry in the session for this EntityKey
    final Object existing = context.getSession().getEntityUsingInterceptor( entityKey );
    if ( existing != null ) {
      // It is previously associated with the Session, perform some checks
      if ( ! entityReference.getEntityPersister().isInstance( existing ) ) {
        throw new WrongClassException(
            "loaded object was of wrong class " + existing.getClass(),
            entityKey.getIdentifier(),
            entityReference.getEntityPersister().getEntityName()
        );
      }
View Full Code Here

    final String result = loadable.getSubclassForDiscriminatorValue( discriminatorValue );

    if ( result == null ) {
      // whoops! we got an instance of another class hierarchy branch
      throw new WrongClassException(
          "Discriminator: " + discriminatorValue,
          entityKey.getIdentifier(),
          entityReference.getEntityPersister().getEntityName()
      );
    }
View Full Code Here

          final Object object,
          final LockMode requestedLockMode,
          final SessionImplementor session)
      throws HibernateException, SQLException {
    if ( !persister.isInstance( object ) ) {
      throw new WrongClassException(
          "loaded object was of wrong class " + object.getClass(),
          key.getIdentifier(),
          persister.getEntityName()
      );
    }
View Full Code Here

      final String result = persister.getSubclassForDiscriminatorValue( discriminatorValue );

      if ( result == null ) {
        //woops we got an instance of another class hierarchy branch
        throw new WrongClassException(
            "Discriminator: " + discriminatorValue,
            id,
            persister.getEntityName()
          );
      }
View Full Code Here

    // see if we have an existing entry in the session for this EntityKey
    final Object existing = context.getSession().getEntityUsingInterceptor( entityKey );
    if ( existing != null ) {
      // It is previously associated with the Session, perform some checks
      if ( ! entityReference.getEntityPersister().isInstance( existing ) ) {
        throw new WrongClassException(
            "loaded object was of wrong class " + existing.getClass(),
            entityKey.getIdentifier(),
            entityReference.getEntityPersister().getEntityName()
        );
      }
View Full Code Here

    final String result = loadable.getSubclassForDiscriminatorValue( discriminatorValue );

    if ( result == null ) {
      // whoops! we got an instance of another class hierarchy branch
      throw new WrongClassException(
          "Discriminator: " + discriminatorValue,
          entityKey.getIdentifier(),
          entityReference.getEntityPersister().getEntityName()
      );
    }
View Full Code Here

TOP

Related Classes of org.hibernate.WrongClassException

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.