當前位置: 首頁>>代碼示例>>Java>>正文


Java Type.assemble方法代碼示例

本文整理匯總了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 );
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:21,代碼來源:PersistentMapElementHolder.java

示例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 ) );
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:15,代碼來源:PersistentListElementHolder.java

示例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() );
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:13,代碼來源:PersistentElementHolder.java


注:本文中的org.hibernate.type.Type.assemble方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。