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


Java Type.fromXMLNode方法代碼示例

本文整理匯總了Java中org.hibernate.type.Type.fromXMLNode方法的典型用法代碼示例。如果您正苦於以下問題:Java Type.fromXMLNode方法的具體用法?Java Type.fromXMLNode怎麽用?Java Type.fromXMLNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.hibernate.type.Type的用法示例。


在下文中一共展示了Type.fromXMLNode方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: disassemble

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings("unchecked")
public Serializable disassemble(CollectionPersister persister) throws HibernateException {
	final Type elementType = persister.getElementType();
	final Type indexType = persister.getIndexType();
	final String indexNodeName = getIndexAttributeName( persister );

	final List elements =  element.elements( persister.getElementNodeName() );
	final int length = elements.size();
	final Serializable[] result = new Serializable[length*2];
	int i = 0;
	while ( i < length*2 ) {
		final Element elem = (Element) elements.get( i/2 );
		final Object object = elementType.fromXMLNode( elem, persister.getFactory() );
		final String indexString = getIndex( elem, indexNodeName, i );
		final Object index = ( (XmlRepresentableType) indexType ).fromXMLString( indexString, persister.getFactory() );
		result[i++] = indexType.disassemble( index, getSession(), null );
		result[i++] = elementType.disassemble( object, getSession(), null );
	}
	return result;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:22,代碼來源:PersistentMapElementHolder.java

示例2: disassemble

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings("deprecation")
public Serializable disassemble(CollectionPersister persister) throws HibernateException {
	final Type elementType = persister.getElementType();
	final String indexNodeName = getIndexAttributeName( persister );
	final List elements =  element.elements( persister.getElementNodeName() );
	final int length = elements.size();
	final Serializable[] result = new Serializable[length];
	for ( int i=0; i<length; i++ ) {
		final Element elem = (Element) elements.get( i );
		final Object object = elementType.fromXMLNode( elem, persister.getFactory() );
		final Integer index = IntegerType.INSTANCE.fromString( getIndex( elem, indexNodeName, i ) );
		result[index] = elementType.disassemble( object, getSession(), null );
	}
	return result;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:17,代碼來源:PersistentListElementHolder.java

示例3: equalsSnapshot

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings("deprecation")
public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException {
	final Type elementType = persister.getElementType();
	final ArrayList snapshot = (ArrayList) getSnapshot();
	final List elements = element.elements( persister.getElementNodeName() );
	if ( snapshot.size() != elements.size() ) {
		return false;
	}
	for ( int i=0; i<snapshot.size(); i++ ) {
		final Object old = snapshot.get( i );
		final Element elem = (Element) elements.get( i );
		final Object current = elementType.fromXMLNode( elem, persister.getFactory() );
		if ( elementType.isDirty( old, current, getSession() ) ) {
			return false;
		}
	}
	return true;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:20,代碼來源:PersistentElementHolder.java

示例4: getDeletes

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings({"unchecked", "deprecation"})
public Iterator getDeletes(CollectionPersister persister, boolean indexIsFormula) throws HibernateException {
	final Type elementType = persister.getElementType();
	final ArrayList snapshot = (ArrayList) getSnapshot();
	final List elements = element.elements( persister.getElementNodeName() );
	final ArrayList result = new ArrayList();
	for ( int i=0; i<snapshot.size(); i++ ) {
		final Object old = snapshot.get( i );
		if ( i >= elements.size() ) {
			result.add( old );
		}
		else {
			final Element elem = (Element) elements.get( i );
			final Object object = elementType.fromXMLNode( elem, persister.getFactory() );
			if ( elementType.isDirty( old, object, getSession() ) ) {
				result.add( old );
			}
		}
	}
	return result.iterator();
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:23,代碼來源:PersistentElementHolder.java

示例5: getSnapshot

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings({"unchecked", "deprecation"})
public Serializable getSnapshot(CollectionPersister persister) throws HibernateException {
	final Type elementType = persister.getElementType();
	final String indexNode = getIndexAttributeName( persister );
	final List elements = element.elements( persister.getElementNodeName() );
	final HashMap snapshot = new HashMap( elements.size() );
	for ( int i=0; i<elements.size(); i++ ) {
		final Element elem = (Element) elements.get( i );
		final Object value = elementType.fromXMLNode( elem, persister.getFactory() );
		final Object copy = elementType.deepCopy( value, persister.getFactory() );
		snapshot.put( getIndex( elem, indexNode, i ), copy );
	}
	return snapshot;
	
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:17,代碼來源:PersistentIndexedElementHolder.java

示例6: equalsSnapshot

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings("deprecation")
public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException {
	final Type elementType = persister.getElementType();
	final String indexNode = getIndexAttributeName( persister );
	final HashMap snapshot = (HashMap) getSnapshot();
	final List elements = element.elements( persister.getElementNodeName() );

	if ( snapshot.size() !=  elements.size() ) {
		return false;
	}

	for ( int i=0; i<snapshot.size(); i++ ) {
		final Element elem = (Element) elements.get( i );
		final Object old = snapshot.get( getIndex( elem, indexNode, i ) );
		final Object current = elementType.fromXMLNode( elem, persister.getFactory() );
		if ( elementType.isDirty( old, current, getSession() ) ) {
			return false;
		}
	}
	return true;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:23,代碼來源:PersistentIndexedElementHolder.java

示例7: entries

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings({"deprecation", "unchecked"})
public Iterator entries(CollectionPersister persister) {
	final Type elementType = persister.getElementType();
	final List subElements =  element.elements( persister.getElementNodeName() );
	final int length = subElements.size();
	final List result = new ArrayList(length);
	for ( Object subElementO : subElements ) {
		final Element subElement = (Element) subElementO;
		final Object object = elementType.fromXMLNode( subElement, persister.getFactory() );
		result.add( object );
	}
	return result.iterator();
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:15,代碼來源:PersistentElementHolder.java

示例8: disassemble

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings("deprecation")
public Serializable disassemble(CollectionPersister persister) throws HibernateException {
	final Type collectionElementType = persister.getElementType();
	final List elements =  element.elements( persister.getElementNodeName() );
	final int length = elements.size();
	final Serializable[] result = new Serializable[length];
	for ( int i=0; i<length; i++ ) {
		final Element elem = (Element) elements.get( i );
		final Object object = collectionElementType.fromXMLNode( elem, persister.getFactory() );
		result[i] = collectionElementType.disassemble( object, getSession(), null );
	}
	return result;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:15,代碼來源:PersistentElementHolder.java

示例9: entries

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings({"deprecation", "unchecked"})
public Iterator entries(CollectionPersister persister) {
	final Type elementType = persister.getElementType();
	final String indexNode = getIndexAttributeName( persister );
	final List elements =  element.elements( persister.getElementNodeName() );
	final int length = elements.size();
	final List result = new ArrayList( length );
	for ( int i=0; i<length; i++ ) {
		final Element elem = (Element) elements.get( i );
		final Object object = elementType.fromXMLNode( elem, persister.getFactory() );
		result.add( new IndexedValue( getIndex( elem, indexNode, i ), object ) );
	}
	return result.iterator();
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:16,代碼來源:PersistentIndexedElementHolder.java


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