Package org.hibernate

Examples of org.hibernate.EntityMode


      settings.setAutoCreateSchema( true );
      settings.setAutoDropSchema( true );
    }
    settings.setImportFiles( properties.getProperty( Environment.HBM2DDL_IMPORT_FILES ) );

    EntityMode defaultEntityMode = EntityMode.parse( properties.getProperty( Environment.DEFAULT_ENTITY_MODE ) );
    if ( debugEnabled ) {
      LOG.debugf( "Default entity-mode: %s", defaultEntityMode );
    }
    settings.setDefaultEntityMode( defaultEntityMode );
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 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

   * @param key The key of the collection being requested.
   *
   * @return The loading collection (see discussion above).
   */
  public PersistentCollection getLoadingCollection(final CollectionPersister persister, final Serializable key) {
    final EntityMode em = loadContexts.getPersistenceContext().getSession().getEntityMode();
    final CollectionKey collectionKey = new CollectionKey( persister, key, em );
    if ( log.isTraceEnabled() ) {
      log.trace( "starting attempt to find loading collection [" + MessageHelper.collectionInfoString( persister.getRole(), key ) + "]" );
    }
    final LoadingCollectionEntry loadingCollectionEntry = loadContexts.locateLoadingCollectionEntry( collectionKey );
View Full Code Here

  private void endLoadingCollection(LoadingCollectionEntry lce, CollectionPersister persister) {
    if ( log.isTraceEnabled() ) {
      log.debug( "ending loading collection [" + lce + "]" );
    }
    final SessionImplementor session = getLoadContext().getPersistenceContext().getSession();
    final EntityMode em = session.getEntityMode();

    boolean hasNoQueuedAdds = lce.getCollection().endRead(); // warning: can cause a recursive calls! (proxy initialization)

    if ( persister.getCollectionType().hasHolder( em ) ) {
      getLoadContext().getPersistenceContext().addCollectionHolder( lce.getCollection() );
View Full Code Here

  protected List list;

  public Serializable getSnapshot(CollectionPersister persister) throws HibernateException {

    EntityMode entityMode = getSession().getEntityMode();

    ArrayList clonedList = new ArrayList( list.size() );
    Iterator iter = list.iterator();
    while ( iter.hasNext() ) {
      Object deepCopy = persister.getElementType()
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

    }

    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

    this.bag = ( List ) persister.getCollectionType().instantiate( anticipatedSize );
  }

  public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException {
    Type elementType = persister.getElementType();
    EntityMode entityMode = getSession().getEntityMode();
    List sn = (List) getSnapshot();
    if ( sn.size()!=bag.size() ) return false;
    Iterator iter = bag.iterator();
    while ( iter.hasNext() ) {
      Object elt = iter.next();
View Full Code Here

        log.trace( "processing cascade " + action + " for: " + persister.getEntityName() );
      }

      Type[] types = persister.getPropertyTypes();
      CascadeStyle[] cascadeStyles = persister.getPropertyCascadeStyles();
      EntityMode entityMode = eventSource.getEntityMode();
      boolean hasUninitializedLazyProperties = persister.hasUninitializedLazyProperties( parent, entityMode );
      for ( int i=0; i<types.length; i++) {
        CascadeStyle style = cascadeStyles[i];
        if ( hasUninitializedLazyProperties && persister.getPropertyLaziness()[i] && ! action.performOnLazyProperty() ) {
          //do nothing to avoid a lazy property initialization
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.