本文整理汇总了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);
}
}
示例2: getAccessorPropertyName
public String getAccessorPropertyName( EntityMode mode ) {
if ( mode == EntityMode.DOM4J ) {
return nodeName;
}
else {
return getName();
}
}
示例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 );
}
}
示例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);
}
}
示例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 );
}
}
示例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 );
}
}
示例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;
}
}
示例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 );
}
}
示例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);
}
}
示例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 );
}
}
示例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);
}
}
示例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);
}
}
示例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 );
}
}
示例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();
}
示例15: getEntityMode
public EntityMode getEntityMode() {
return EntityMode.DOM4J;
}