Package org.hibernate

Examples of org.hibernate.EntityMode


    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


    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

    final Object entity = event.getEntity();
    final EntityEntry entry = event.getEntityEntry();
    final EventSource session = event.getSession();
    final EntityPersister persister = entry.getPersister();
    final Status status = entry.getStatus();
    final EntityMode entityMode = session.getEntityMode();
    final Type[] types = persister.getPropertyTypes();

    final boolean mightBeDirty = entry.requiresDirtyCheck(entity);

    final Object[] values = getValues( entity, entry, entityMode, mightBeDirty, session );
View Full Code Here

   
    final EntityEntry entry = event.getEntityEntry();
    final EventSource session = event.getSession();
    final Object entity = event.getEntity();
    final Status status = entry.getStatus();
    final EntityMode entityMode = session.getEntityMode();
    final EntityPersister persister = entry.getPersister();
    final Object[] values = event.getPropertyValues();
   
    if ( log.isTraceEnabled() ) {
      if ( status == Status.DELETED ) {
View Full Code Here

    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

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

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

        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

    // then handle any user-defined entity modes...
    if ( !userSuppliedTuplizerImpls.isEmpty() ) {
      Iterator itr = userSuppliedTuplizerImpls.entrySet().iterator();
      while ( itr.hasNext() ) {
        final Map.Entry entry = ( Map.Entry ) itr.next();
        final EntityMode entityMode = ( EntityMode ) entry.getKey();
        final String tuplizerClassName = ( String ) entry.getValue();
        final EntityTuplizer tuplizer = entityTuplizerFactory.constructTuplizer( tuplizerClassName, em, mappedEntity );
        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.