Package org.hibernate

Examples of org.hibernate.EntityMode


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


  }


  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

    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

    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

    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

  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

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.