当前位置: 首页>>代码示例>>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;未经允许,请勿转载。