Package org.hibernate

Examples of org.hibernate.EntityMode


    setInitialized();
    setDirectlyAccessible(true);
  }

  public Serializable getSnapshot(CollectionPersister persister) throws HibernateException {
    EntityMode entityMode = getSession().getEntityMode();
    HashMap clonedMap = new HashMap( map.size() );
    Iterator iter = map.entrySet().iterator();
    while ( iter.hasNext() ) {
      Map.Entry e = (Map.Entry) iter.next();
      final Object copy = persister.getElementType()
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

   * @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

   * @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

    if ( "create-drop".equals(autoSchemaExport) ) {
      settings.setAutoCreateSchema(true);
      settings.setAutoDropSchema(true);
    }

    EntityMode defaultEntityMode = EntityMode.parse( properties.getProperty( Environment.DEFAULT_ENTITY_MODE ) );
    log.info( "Default entity-mode: " + defaultEntityMode );
    settings.setDefaultEntityMode( defaultEntityMode );

    boolean namedQueryChecking = PropertiesHelper.getBoolean( Environment.QUERY_STARTUP_CHECKING, properties, true );
    log.info( "Named query checking : " + enabledDisabled( namedQueryChecking ) );
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();
        ComponentTuplizer tuplizer = buildComponentTuplizer( ( String ) entry.getValue(), component );
        addTuplizer( entityMode, tuplizer );
      }
    }
  }
View Full Code Here

  }
 
  private EntityMode getEntityMode(Criteria criteria, CriteriaQuery criteriaQuery) {
    EntityPersister meta = criteriaQuery.getFactory()
        .getEntityPersister( criteriaQuery.getEntityName(criteria) );
    EntityMode result = meta.guessEntityMode(entity);
    if (result==null) {
      throw new ClassCastException( entity.getClass().getName() );
    }
    return result;
  }
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

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.