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


Java Type.isDirty方法代碼示例

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


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

示例1: equalsSnapshot

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException {
	final Type elementType = persister.getElementType();
	final Map snap = (Map) getSnapshot();
	if ( snap.size()!= values.size() ) {
		return false;
	}
	for ( int i=0; i<values.size(); i++ ) {
		final Object value = values.get( i );
		final Object id = identifiers.get( i );
		if ( id == null ) {
			return false;
		}
		final Object old = snap.get( id );
		if ( elementType.isDirty( old, value, getSession() ) ) {
			return false;
		}
	}
	return true;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:21,代碼來源:PersistentIdentifierBag.java

示例2: equalsSnapshot

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException {
	final Type elementType = persister.getElementType();
	final List sn = (List) getSnapshot();
	if ( sn.size()!=this.list.size() ) {
		return false;
	}
	final Iterator itr = list.iterator();
	final Iterator snapshotItr = sn.iterator();
	while ( itr.hasNext() ) {
		if ( elementType.isDirty( itr.next(), snapshotItr.next(), getSession() ) ) {
			return false;
		}
	}
	return true;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:17,代碼來源:PersistentList.java

示例3: equalsSnapshot

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException {
	final Type elementType = persister.getElementType();
	final Map snapshotMap = (Map) getSnapshot();
	if ( snapshotMap.size() != this.map.size() ) {
		return false;
	}

	for ( Object o : map.entrySet() ) {
		final Entry entry = (Entry) o;
		if ( elementType.isDirty( entry.getValue(), snapshotMap.get( entry.getKey() ), getSession() ) ) {
			return false;
		}
	}
	return true;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:17,代碼來源:PersistentMap.java

示例4: 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

示例5: 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

示例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: equalsSnapshot

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException {
	final Type elementType = persister.getElementType();
	final java.util.Map sn = (java.util.Map) getSnapshot();
	if ( sn.size()!=set.size() ) {
		return false;
	}
	else {
		for ( Object test : set ) {
			final Object oldValue = sn.get( test );
			if ( oldValue == null || elementType.isDirty( oldValue, test, getSession() ) ) {
				return false;
			}
		}
		return true;
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:18,代碼來源:PersistentSet.java

示例8: needsUpdating

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
public boolean needsUpdating(Object entry, int i, Type elemType) throws HibernateException {
	if ( entry == null ) {
		return false;
	}

	final Map snap = (Map) getSnapshot();
	final Object id = identifiers.get( i );
	if ( id == null ) {
		return false;
	}

	final Object old = snap.get( id );
	return old != null && elemType.isDirty( old, entry, getSession() );
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:16,代碼來源:PersistentIdentifierBag.java

示例9: needsUpdating

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
public boolean needsUpdating(Object entry, int i, Type elemType) throws HibernateException {
	final List sn = (List) getSnapshot();
	return i < sn.size()
			&& sn.get( i ) != null
			&& list.get( i ) != null
			&& elemType.isDirty( list.get( i ), sn.get( i ), getSession() );
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:9,代碼來源:PersistentList.java

示例10: needsUpdating

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings("unchecked")
public boolean needsUpdating(Object entry, int i, Type elemType) throws HibernateException {
	final Map sn = (Map) getSnapshot();
	final Map.Entry e = (Map.Entry) entry;
	final Object snValue = sn.get( e.getKey() );
	return e.getValue() != null
			&& snValue != null
			&& elemType.isDirty( snValue, e.getValue(), getSession() );
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:11,代碼來源:PersistentMap.java

示例11: needsUpdating

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
public boolean needsUpdating(Object entry, int i, Type elementType) throws HibernateException {
	final HashMap snapshot = (HashMap) getSnapshot();
	final IndexedValue iv = (IndexedValue) entry;
	final Object old = snapshot.get( iv.index );
	return old!=null && elementType.isDirty( old, iv.value, getSession() );
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:8,代碼來源:PersistentIndexedElementHolder.java

示例12: equalsSnapshot

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException {
	final Type elementType = persister.getElementType();
	final Serializable snapshot = getSnapshot();
	final int xlen = Array.getLength( snapshot );
	if ( xlen!= Array.getLength( array ) ) {
		return false;
	}
	for ( int i=0; i<xlen; i++) {
		if ( elementType.isDirty( Array.get( snapshot, i ), Array.get( array, i ), getSession() ) ) {
			return false;
		}
	}
	return true;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:16,代碼來源:PersistentArrayHolder.java

示例13: needsUpdating

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
public boolean needsUpdating(Object entry, int i, Type elemType) throws HibernateException {
	final Serializable sn = getSnapshot();
	return i < Array.getLength( sn )
			&& Array.get( sn, i ) != null
			&& Array.get( array, i ) != null
			&& elemType.isDirty( Array.get( array, i ), Array.get( sn, i ), getSession() );
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:9,代碼來源:PersistentArrayHolder.java

示例14: needsInserting

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
@SuppressWarnings("unchecked")
public boolean needsInserting(Object entry, int i, Type elemType) throws HibernateException {
	final Object oldValue = ( (java.util.Map) getSnapshot() ).get( entry );
	// note that it might be better to iterate the snapshot but this is safe,
	// assuming the user implements equals() properly, as required by the Set
	// contract!
	return oldValue == null || elemType.isDirty( oldValue, entry, getSession() );
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:PersistentSet.java

示例15: needsInserting

import org.hibernate.type.Type; //導入方法依賴的package包/類
@Override
public boolean needsInserting(Object entry, int i, Type elementType) throws HibernateException {
	final ArrayList snapshot = (ArrayList) getSnapshot();
	return i >= snapshot.size()
			|| elementType.isDirty( snapshot.get( i ), entry, getSession() );
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:7,代碼來源:PersistentElementHolder.java


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