当前位置: 首页>>代码示例>>Java>>正文


Java EntityMode.DOM4J属性代码示例

本文整理汇总了Java中org.hibernate.EntityMode.DOM4J属性的典型用法代码示例。如果您正苦于以下问题:Java EntityMode.DOM4J属性的具体用法?Java EntityMode.DOM4J怎么用?Java EntityMode.DOM4J使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.hibernate.EntityMode的用法示例。


在下文中一共展示了EntityMode.DOM4J属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getElementsIterator

/**
 * Get an iterator over the element set of the collection, which may not yet be wrapped
 *
 * @param collection The collection to be iterated
 * @param session The session from which the request is originating.
 * @return The iterator.
 */
public Iterator getElementsIterator(Object collection, SessionImplementor session) {
	if ( session.getEntityMode()==EntityMode.DOM4J ) {
		final SessionFactoryImplementor factory = session.getFactory();
		final CollectionPersister persister = factory.getCollectionPersister( getRole() );
		final Type elementType = persister.getElementType();
		
		List elements = ( (Element) collection ).elements( persister.getElementNodeName() );
		ArrayList results = new ArrayList();
		for ( int i=0; i<elements.size(); i++ ) {
			Element value = (Element) elements.get(i);
			results.add( elementType.fromXMLNode( value, factory ) );
		}
		return results.iterator();
	}
	else {
		return getElementsIterator(collection);
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:25,代码来源:CollectionType.java

示例2: getAccessorPropertyName

public String getAccessorPropertyName( EntityMode mode ) {
	if ( mode == EntityMode.DOM4J ) {
		return nodeName;
	}
	else {
		return getName();
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:Property.java

示例3: wrap

public PersistentCollection wrap(SessionImplementor session, Object collection) {
	if ( session.getEntityMode() == EntityMode.DOM4J ) {
		throw new IllegalStateException( "dom4j not supported" );
	}
	else {
		return new PersistentDefaultableList( session, ( List ) collection );
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:DefaultableListType.java

示例4: instantiate

public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key)
throws HibernateException {
	if ( session.getEntityMode()==EntityMode.DOM4J ) {
		return new PersistentElementHolder(session, persister, key);
	}
	else {
		return new PersistentBag(session);
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:9,代码来源:BagType.java

示例5: wrap

public PersistentCollection wrap(SessionImplementor session, Object collection) {
	if ( session.getEntityMode()==EntityMode.DOM4J ) {
		return new PersistentElementHolder( session, (Element) collection );
	}
	else {
		return new PersistentBag( session, (Collection) collection );
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:BagType.java

示例6: wrap

public PersistentCollection wrap(SessionImplementor session, Object collection) {
	if ( session.getEntityMode()==EntityMode.DOM4J ) {
		throw new IllegalStateException("dom4j not supported");
	}
	else {
		return new PersistentMyList( session, (IMyList) collection );
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:MyListType.java

示例7: instantiate

public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) {
	if ( session.getEntityMode()==EntityMode.DOM4J ) {
		return new PersistentElementHolder(session, persister, key);
	}
	else {
		PersistentSortedSet set = new PersistentSortedSet(session);
		set.setComparator(comparator);
		return set;
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:10,代码来源:SortedSetType.java

示例8: wrap

public PersistentCollection wrap(SessionImplementor session, Object collection) {
	if ( session.getEntityMode()==EntityMode.DOM4J ) {
		return new PersistentElementHolder( session, (Element) collection );
	}
	else {
		return new PersistentSortedSet( session, (java.util.SortedSet) collection );
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:SortedSetType.java

示例9: instantiate

public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) {
	if ( session.getEntityMode()==EntityMode.DOM4J ) {
		return new PersistentElementHolder(session, persister, key);
	}
	else {
		return new PersistentSet(session);
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:SetType.java

示例10: wrap

public PersistentCollection wrap(SessionImplementor session, Object collection) {
	if ( session.getEntityMode()==EntityMode.DOM4J ) {
		return new PersistentElementHolder( session, (Element) collection );
	}
	else {
		return new PersistentSet( session, (java.util.Set) collection );
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:SetType.java

示例11: instantiate

public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) {
	if ( session.getEntityMode()==EntityMode.DOM4J ) {
		return new PersistentListElementHolder(session, persister, key);
	}
	else {
		return new PersistentList(session);
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:ListType.java

示例12: instantiate

public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) {
	if ( session.getEntityMode()==EntityMode.DOM4J ) {
		return new PersistentMapElementHolder(session, persister, key);
	}
	else {
		return new PersistentMap(session);
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:MapType.java

示例13: wrap

public PersistentCollection wrap(SessionImplementor session, Object collection) {
	if ( session.getEntityMode()==EntityMode.DOM4J ) {
		return new PersistentMapElementHolder( session, (Element) collection );
	}
	else {
		return new PersistentMap( session, (java.util.Map) collection );
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:MapType.java

示例14: getCollection

/**
 * instantiate a collection wrapper (called when loading an object)
 *
 * @param key The collection owner key
 * @param session The session from which the request is originating.
 * @param owner The collection owner
 * @return The collection
 */
public Object getCollection(Serializable key, SessionImplementor session, Object owner) {

	CollectionPersister persister = getPersister( session );
	final PersistenceContext persistenceContext = session.getPersistenceContext();
	final EntityMode entityMode = session.getEntityMode();

	if (entityMode==EntityMode.DOM4J && !isEmbeddedInXML) {
		return UNFETCHED_COLLECTION;
	}

	// check if collection is currently being loaded
	PersistentCollection collection = persistenceContext.getLoadContexts().locateLoadingCollection( persister, key );
	if ( collection == null ) {
		// check if it is already completely loaded, but unowned
		collection = persistenceContext.useUnownedCollection( new CollectionKey(persister, key, entityMode) );
		if ( collection == null ) {
			// create a new collection wrapper, to be initialized later
			collection = instantiate( session, persister, key );
			collection.setOwner( owner );

			persistenceContext.addUninitializedCollection( persister, collection, key );

			// some collections are not lazy:
			if ( initializeImmediately( entityMode ) ) {
				session.initializeCollection( collection, false );
			}
			else if ( !persister.isLazy() ) {
				persistenceContext.addNonLazyCollection( collection );
			}

			if ( hasHolder( entityMode ) ) {
				session.getPersistenceContext().addCollectionHolder( collection );
			}
		}
	}
	collection.setOwner( owner );
	return collection.getValue();
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:46,代码来源:CollectionType.java

示例15: getEntityMode

public EntityMode getEntityMode() {
	return EntityMode.DOM4J;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:3,代码来源:Dom4jEntityTuplizer.java


注:本文中的org.hibernate.EntityMode.DOM4J属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。