Methods Summary |
---|
public java.util.Iterator | getElementsIterator(java.lang.Object collection)Not defined for collections of primitive type
return Arrays.asList( (Object[]) collection ).iterator();
|
public java.lang.Class | getReturnedClass()
return arrayClass;
|
public boolean | hasHolder(org.hibernate.EntityMode entityMode)
return true;
|
public java.lang.Object | indexOf(java.lang.Object array, java.lang.Object element)
int length = Array.getLength(array);
for ( int i=0; i<length; i++ ) {
//TODO: proxies!
if ( Array.get(array, i)==element ) return new Integer(i);
}
return null;
|
protected boolean | initializeImmediately(org.hibernate.EntityMode entityMode)
return true;
|
public java.lang.Object | instantiate(int anticipatedSize)
throw new UnsupportedOperationException();
|
public org.hibernate.collection.PersistentCollection | instantiate(org.hibernate.engine.SessionImplementor session, org.hibernate.persister.collection.CollectionPersister persister, java.io.Serializable key)
return new PersistentArrayHolder(session, persister);
|
public java.lang.Object | instantiateResult(java.lang.Object original)
return Array.newInstance( elementClass, Array.getLength(original) );
|
public boolean | isArrayType()
return true;
|
public java.lang.Object | replaceElements(java.lang.Object original, java.lang.Object target, java.lang.Object owner, java.util.Map copyCache, org.hibernate.engine.SessionImplementor session)
int length = Array.getLength(original);
if ( length!=Array.getLength(target) ) {
//note: this affects the return value!
target=instantiateResult(original);
}
Type elemType = getElementType( session.getFactory() );
for ( int i=0; i<length; i++ ) {
Array.set( target, i, elemType.replace( Array.get(original, i), null, session, owner, copyCache ) );
}
return target;
|
public java.lang.String | toLoggableString(java.lang.Object value, org.hibernate.engine.SessionFactoryImplementor factory)
if ( value == null ) {
return "null";
}
int length = Array.getLength(value);
List list = new ArrayList(length);
Type elemType = getElementType(factory);
for ( int i=0; i<length; i++ ) {
list.add( elemType.toLoggableString( Array.get(value, i), factory ) );
}
return list.toString();
|
public org.hibernate.collection.PersistentCollection | wrap(org.hibernate.engine.SessionImplementor session, java.lang.Object array)
return new PersistentArrayHolder(session, array);
|