Package org.hibernate

Examples of org.hibernate.EntityMode


    }

    //tuplizers
    if ( annotatedClass.isAnnotationPresent( Tuplizers.class ) ) {
      for (Tuplizer tuplizer : annotatedClass.getAnnotation( Tuplizers.class ).value()) {
        EntityMode mode = EntityMode.parse( tuplizer.entityMode() );
        persistentClass.addTuplizer( mode, tuplizer.impl().getName() );
      }
    }
    if ( annotatedClass.isAnnotationPresent( Tuplizer.class ) ) {
      Tuplizer tuplizer = annotatedClass.getAnnotation( Tuplizer.class );
      EntityMode mode = EntityMode.parse( tuplizer.entityMode() );
      persistentClass.addTuplizer( mode, tuplizer.impl().getName() );
    }

    if ( !inheritanceState.hasParents ) {
      Iterator<Map.Entry<String, String>> iter = filters.entrySet().iterator();
View Full Code Here


  }


  public Serializable getSnapshot(CollectionPersister persister)
  throws HibernateException {
    EntityMode entityMode = getSession().getEntityMode();
   
    //if (set==null) return new Set(session);
    HashMap clonedSet = new HashMap( set.size() );
    Iterator iter = set.iterator();
    while ( iter.hasNext() ) {
View Full Code Here

    // then handle any user-defined entity modes...
    if ( !userSuppliedTuplizerImpls.isEmpty() ) {
      Iterator itr = userSuppliedTuplizerImpls.entrySet().iterator();
      while ( itr.hasNext() ) {
        Map.Entry entry = ( Map.Entry ) itr.next();
        EntityMode entityMode = ( EntityMode ) entry.getKey();
        EntityTuplizer tuplizer = buildEntityTuplizer( ( String ) entry.getValue(), mappedEntity, em );
        addTuplizer( entityMode, tuplizer );
      }
    }
  }
View Full Code Here

    }

    iter = node.elementIterator( "tuplizer" );
    while ( iter.hasNext() ) {
      final Element tuplizerElem = ( Element ) iter.next();
      EntityMode mode = EntityMode.parse( tuplizerElem.attributeValue( "entity-mode" ) );
      component.addTuplizer( mode, tuplizerElem.attributeValue( "class" ) );
    }
  }
View Full Code Here

  }

  public Serializable getSnapshot(CollectionPersister persister)
    throws HibernateException {
   
    EntityMode entityMode = getSession().getEntityMode();
   
    HashMap map = new HashMap( values.size() );
    Iterator iter = values.iterator();
    int i=0;
    while ( iter.hasNext() ) {
View Full Code Here

   */
  public Object getCollection(Serializable key, SessionImplementor session, Object owner) {

    CollectionPersister persister = getPersister( session );
    final PersistenceContext persistenceContext = session.getPersistenceContext();
    final EntityMode entityMode = session.getEntityMode();

    if (entityMode==EntityMode.DOM4J && !isEmbeddedInXML) {
      return UNFETCHED_COLLECTION;
    }

View Full Code Here

    this.array = array;
    setInitialized();
  }

  public Serializable getSnapshot(CollectionPersister persister) throws HibernateException {
    EntityMode entityMode = getSession().getEntityMode();
    int length = /*(array==null) ? tempList.size() :*/ Array.getLength(array);
    Serializable result = (Serializable) Array.newInstance( persister.getElementClass(), length );
    for ( int i=0; i<length; i++ ) {
      Object elt = /*(array==null) ? tempList.get(i) :*/ Array.get(array, i);
      try {
View Full Code Here

   
    EntityPersister persister = factory.getEntityPersister( associatedEntityName );
    StringBuffer result = new StringBuffer().append( associatedEntityName );

    if ( persister.hasIdentifierProperty() ) {
      final EntityMode entityMode = persister.guessEntityMode( value );
      final Serializable id;
      if ( entityMode == null ) {
        if ( isEmbeddedInXML ) {
          throw new ClassCastException( value.getClass().getName() );
        }
View Full Code Here

      return false;
    }
    if ( x == null || y == null ) {
      return true;
    }
    EntityMode entityMode = session.getEntityMode();
    Object[] xvalues = getPropertyValues( x, entityMode );
    Object[] yvalues = getPropertyValues( y, entityMode );
    for ( int i = 0; i < xvalues.length; i++ ) {
      if ( propertyTypes[i].isDirty( xvalues[i], yvalues[i], session ) ) {
        return true;
View Full Code Here

      return false;
    }
    if ( x == null || y == null ) {
      return true;
    }
    EntityMode entityMode = session.getEntityMode();
    Object[] xvalues = getPropertyValues( x, entityMode );
    Object[] yvalues = getPropertyValues( y, entityMode );
    int loc = 0;
    for ( int i = 0; i < xvalues.length; i++ ) {
      int len = propertyTypes[i].getColumnSpan( session.getFactory() );
View Full Code Here

TOP

Related Classes of org.hibernate.EntityMode

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.