Package org.hibernate

Examples of org.hibernate.EntityMode


    return result;
  }

  public Serializable getSnapshot(CollectionPersister persister)
  throws HibernateException {
    EntityMode entityMode = getSession().getEntityMode();
    ArrayList clonedList = new ArrayList( bag.size() );
    Iterator iter = bag.iterator();
    while ( iter.hasNext() ) {
      clonedList.add( persister.getElementType().deepCopy( iter.next(), entityMode, persister.getFactory() ) );
    }
View Full Code Here


  // <one-to-many> <bag>!

  public Iterator getDeletes(CollectionPersister persister, boolean indexIsFormula) throws HibernateException {
    //if ( !persister.isOneToMany() ) throw new AssertionFailure("Not implemented for Bags");
    Type elementType = persister.getElementType();
    EntityMode entityMode = getSession().getEntityMode();
    ArrayList deletes = new ArrayList();
    List sn = (List) getSnapshot();
    Iterator olditer = sn.iterator();
    int i=0;
    while ( olditer.hasNext() ) {
View Full Code Here

  }

  public boolean needsInserting(Object entry, int i, Type elemType) throws HibernateException {
    //if ( !persister.isOneToMany() ) throw new AssertionFailure("Not implemented for Bags");
    List sn = (List) getSnapshot();
    final EntityMode entityMode = getSession().getEntityMode();
    if ( sn.size()>i && elemType.isSame( sn.get(i), entry, entityMode ) ) {
    //a shortcut if its location didn't change!
      return false;
    }
    else {
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

    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

    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

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

    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

    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

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.