Package org.hibernate

Examples of org.hibernate.EntityMode


      throws HibernateException {
    if ( value == null ) {
      return "null";
    }
    Map result = new HashMap();
    EntityMode entityMode = tuplizerMapping.guessEntityMode( value );
    if ( entityMode == null ) {
      throw new ClassCastException( value.getClass().getName() );
    }
    Object[] values = getPropertyValues( value, entityMode );
    for ( int i = 0; i < propertyTypes.length; i++ ) {
View Full Code Here


    final Object result = target == null
        ? instantiate( owner, session )
        : target;

    final EntityMode entityMode = session.getEntityMode();
    Object[] values = TypeFactory.replace(
        getPropertyValues( original, entityMode ),
        getPropertyValues( result, entityMode ),
        propertyTypes,
        session,
View Full Code Here

    final Object result = target == null ?
        instantiate( owner, session ) :
        target;

    final EntityMode entityMode = session.getEntityMode();
    Object[] values = TypeFactory.replace(
        getPropertyValues( original, entityMode ),
        getPropertyValues( result, entityMode ),
        propertyTypes,
        session,
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

    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

    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

  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

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.