Package org.hibernate

Examples of org.hibernate.EntityMode


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


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

    return null;
  }

  void process(Object object, EntityPersister persister) throws HibernateException {
    EntityMode entityMode = getSession().getEntityMode();
    Object[] values = persister.getPropertyValues( object, entityMode );
    Type[] types = persister.getPropertyTypes();
    processEntityPropertyValues(values, types);
    if ( isSubstitutionRequired() ) {
      persister.setPropertyValues( object, values, entityMode );
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 userTuplizerClassName = ( String ) entry.getValue();
        ComponentTuplizer tuplizer = componentTuplizerFactory.constructTuplizer( userTuplizerClassName, component );
        addTuplizer( entityMode, tuplizer );
      }
    }
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

        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

    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

  }

  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

        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

  private static void setupComponentTuplizer(XProperty property, Component component) {
    if ( property == null ) return;
    if ( property.isAnnotationPresent( Tuplizers.class ) ) {
      for (Tuplizer tuplizer : property.getAnnotation( Tuplizers.class ).value()) {
        EntityMode mode = EntityMode.parse( tuplizer.entityMode() );
        component.addTuplizer( mode, tuplizer.impl().getName() );
      }
    }
    if ( property.isAnnotationPresent( Tuplizer.class ) ) {
      Tuplizer tuplizer = property.getAnnotation( Tuplizer.class );
      EntityMode mode = EntityMode.parse( tuplizer.entityMode() );
      component.addTuplizer( mode, tuplizer.impl().getName() );
    }
  }
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.