本文整理汇总了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() );
}
}