本文整理匯總了Java中org.hibernate.type.Type.assemble方法的典型用法代碼示例。如果您正苦於以下問題:Java Type.assemble方法的具體用法?Java Type.assemble怎麽用?Java Type.assemble使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.hibernate.type.Type
的用法示例。
在下文中一共展示了Type.assemble方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initializeFromCache
import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings("unchecked")
public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner) {
final Type elementType = persister.getElementType();
final Type indexType = persister.getIndexType();
final String indexNodeName = getIndexAttributeName( persister );
final Serializable[] cached = (Serializable[]) disassembled;
int i = 0;
while ( i < cached.length ) {
final Object index = indexType.assemble( cached[i++], getSession(), owner );
final Object object = elementType.assemble( cached[i++], getSession(), owner );
final Element subElement = element.addElement( persister.getElementNodeName() );
elementType.setToXMLNode( subElement, object, persister.getFactory() );
final String indexString = ( (XmlRepresentableType) indexType ).toXMLString( index, persister.getFactory() );
setIndex( subElement, indexNodeName, indexString );
}
}
示例2: initializeFromCache
import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings("deprecation")
public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner)
throws HibernateException {
final Type elementType = persister.getElementType();
final String indexNodeName = getIndexAttributeName( persister );
final Serializable[] cached = (Serializable[]) disassembled;
for ( int i=0; i<cached.length; i++ ) {
final Object object = elementType.assemble( cached[i], getSession(), owner );
final Element subelement = element.addElement( persister.getElementNodeName() );
elementType.setToXMLNode( subelement, object, persister.getFactory() );
setIndex( subelement, indexNodeName, Integer.toString( i ) );
}
}
示例3: initializeFromCache
import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings("deprecation")
public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner)
throws HibernateException {
final Type collectionElementType = persister.getElementType();
final Serializable[] cachedSnapshot = (Serializable[]) disassembled;
for ( Serializable cachedItem : cachedSnapshot ) {
final Object object = collectionElementType.assemble( cachedItem, getSession(), owner );
final Element subElement = element.addElement( persister.getElementNodeName() );
collectionElementType.setToXMLNode( subElement, object, persister.getFactory() );
}
}