Object processCollection(Object collection, CollectionType type) throws HibernateException { if ( collection != null ) { final SessionImplementor session = getSession(); final PersistentCollection persistentCollection; if ( type.isArrayType() ) { persistentCollection = session.getPersistenceContext().getCollectionHolder( collection ); // if no array holder we found an unwrappered array (this can't occur, // because we now always call wrap() before getting to here) // return (ah==null) ? true : searchForDirtyCollections(ah, type); } else { // if not wrappered yet, its dirty (this can't occur, because // we now always call wrap() before getting to here) // return ( ! (obj instanceof PersistentCollection) ) ? //true : searchForDirtyCollections( (PersistentCollection) obj, type ); persistentCollection = (PersistentCollection) collection; } if ( persistentCollection.isDirty() ) { //we need to check even if it was not initialized, because of delayed adds! dirty = true; return null; //NOTE: EARLY EXIT! } } return null; }
if ( collectionType.isArrayType() ) { session.getPersistenceContext().addCollectionHolder( collection );
@Override public boolean isArrayType() { return type.isArrayType(); }
private static org.hibernate.ogm.model.key.spi.AssociationType getAssociationType(Collection collection) { CollectionType collectionType = collection.getCollectionType(); if ( collectionType.isArrayType() ) { return org.hibernate.ogm.model.key.spi.AssociationType.LIST; } else if ( collectionType instanceof SetType ) { return org.hibernate.ogm.model.key.spi.AssociationType.SET; } else if ( collectionType instanceof MapType ) { return org.hibernate.ogm.model.key.spi.AssociationType.MAP; } else if ( collectionType instanceof ListType ) { return org.hibernate.ogm.model.key.spi.AssociationType.LIST; } else { return org.hibernate.ogm.model.key.spi.AssociationType.BAG; } }
Object processCollection(Object collection, CollectionType type) throws HibernateException { if (collection!=null) { SessionImplementor session = getSession(); final PersistentCollection persistentCollection; if ( type.isArrayType() ) { persistentCollection = session.getPersistenceContext().getCollectionHolder(collection); // if no array holder we found an unwrappered array (this can't occur, // because we now always call wrap() before getting to here) // return (ah==null) ? true : searchForDirtyCollections(ah, type); } else { // if not wrappered yet, its dirty (this can't occur, because // we now always call wrap() before getting to here) // return ( ! (obj instanceof PersistentCollection) ) ? //true : searchForDirtyCollections( (PersistentCollection) obj, type ); persistentCollection = (PersistentCollection) collection; } if ( persistentCollection.isDirty() ) { //we need to check even if it was not initialized, because of delayed adds! dirty=true; return null; //NOTE: EARLY EXIT! } } return null; }
Object processCollection(Object collection, CollectionType type) throws HibernateException { if (collection!=null) { SessionImplementor session = getSession(); final PersistentCollection persistentCollection; if ( type.isArrayType() ) { persistentCollection = session.getPersistenceContext().getCollectionHolder(collection); // if no array holder we found an unwrappered array (this can't occur, // because we now always call wrap() before getting to here) // return (ah==null) ? true : searchForDirtyCollections(ah, type); } else { // if not wrappered yet, its dirty (this can't occur, because // we now always call wrap() before getting to here) // return ( ! (obj instanceof PersistentCollection) ) ? //true : searchForDirtyCollections( (PersistentCollection) obj, type ); persistentCollection = (PersistentCollection) collection; } if ( persistentCollection.isDirty() ) { //we need to check even if it was not initialized, because of delayed adds! dirty=true; return null; //NOTE: EARLY EXIT! } } return null; }
Object processCollection(Object collection, CollectionType type) throws HibernateException { if (collection!=null) { SessionImplementor session = getSession(); final PersistentCollection persistentCollection; if ( type.isArrayType() ) { persistentCollection = session.getPersistenceContext().getCollectionHolder(collection); // if no array holder we found an unwrappered array (this can't occur, // because we now always call wrap() before getting to here) // return (ah==null) ? true : searchForDirtyCollections(ah, type); } else { // if not wrappered yet, its dirty (this can't occur, because // we now always call wrap() before getting to here) // return ( ! (obj instanceof PersistentCollection) ) ? //true : searchForDirtyCollections( (PersistentCollection) obj, type ); persistentCollection = (PersistentCollection) collection; } if ( persistentCollection.isDirty() ) { //we need to check even if it was not initialized, because of delayed adds! dirty=true; return null; //NOTE: EARLY EXIT! } } return null; }
Object processCollection(Object collection, CollectionType type) throws HibernateException { if (collection!=null) { SessionImplementor session = getSession(); final PersistentCollection coll; if ( type.isArrayType() ) { coll = session.getPersistenceContext().getCollectionHolder(collection); // if no array holder we found an unwrappered array (this can't occur, // because we now always call wrap() before getting to here) // return (ah==null) ? true : searchForDirtyCollections(ah, type); } else { // if not wrappered yet, its dirty (this can't occur, because // we now always call wrap() before getting to here) // return ( ! (obj instanceof PersistentCollection) ) ? //true : searchForDirtyCollections( (PersistentCollection) obj, type ); coll = (PersistentCollection) collection; } if ( session.getPersistenceContext().getCollectionEntry(coll).isInitializedAndDirty() ) { dirty=true; return null; //NOTE: EARLY EXIT! } } return null; }