本文整理了Java中org.hibernate.mapping.Bag
类的一些代码示例,展示了Bag
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bag
类的具体详情如下:
包路径:org.hibernate.mapping.Bag
类名称:Bag
[英]A bag permits duplicates, so it has no primary key
[中]包允许复制,因此它没有主键
代码示例来源:origin: hibernate/hibernate-orm
protected Collection createCollection(PersistentClass persistentClass) {
return new org.hibernate.mapping.Bag( getBuildingContext(), persistentClass );
}
}
代码示例来源:origin: hibernate/hibernate-orm
public CollectionType getDefaultCollectionType() {
return getMetadata().getTypeResolver()
.getTypeFactory()
.bag( getRole(), getReferencedPropertyName() );
}
代码示例来源:origin: com.manydesigns/portofino-database
Bag set = new Bag(mappings, clazzOne);
set.setLazy(LAZY);
set.setRole(relationship.getToTable().getActualEntityName()+"."+relationship.getActualManyPropertyName());
set.setCollectionTable(clazzMany.getTable());
OneToMany oneToMany = new OneToMany(mappings, set.getOwner());
set.setElement(oneToMany);
set.setSorted(false);
set.setFetchMode(FetchMode.DEFAULT);
dv.setTypeName(null);
dv.setNullable(false);
set.setKey(dv);
} else {
set.setReferencedPropertyName(m2o.getReferencedPropertyName());
KeyValue keyVal = (KeyValue) set.getOwner().getReferencedProperty(m2o.getReferencedPropertyName()).getValue();
set.setKey(keyVal);
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
public CollectionType getDefaultCollectionType() {
return getMappings().getTypeResolver()
.getTypeFactory()
.bag( getRole(), getReferencedPropertyName(), isEmbedded() );
}
代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all
public CollectionType getDefaultCollectionType() {
return TypeFactory.bag( getRole(), getReferencedPropertyName(), isEmbedded() );
}
代码示例来源:origin: org.grails/grails-datastore-gorm-hibernate-core
@Override
public Collection create(ToMany property, PersistentClass owner,
String path, Mappings mappings, String sessionFactoryBeanName) throws MappingException {
Bag coll = new Bag(mappings, owner);
coll.setCollectionTable(owner.getTable());
coll.setTypeName(getTypeName(property));
binder.bindCollection(property, coll, owner, mappings, path, sessionFactoryBeanName);
return coll;
}
};
代码示例来源:origin: org.grails/grails-hibernate
@Override
public Collection create(GrailsDomainClassProperty property, PersistentClass owner,
String path, Mappings mappings, String sessionFactoryBeanName) throws MappingException {
Bag coll = new Bag(mappings, owner);
coll.setCollectionTable(owner.getTable());
bindCollection(property, coll, owner, mappings, path, sessionFactoryBeanName);
return coll;
}
};
代码示例来源:origin: hibernate/hibernate-orm
@Test
public void testProperCallbacks() {
final MetadataImplementor metadata =
(MetadataImplementor) new MetadataSources( serviceRegistry )
.buildMetadata();
final Table tbl = new Table();
final RootClass rootClass = new RootClass( metadataBuildingContext );
ValueVisitor vv = new ValueVisitorValidator();
MetadataBuildingContextTestingImpl metadataBuildingContext = new MetadataBuildingContextTestingImpl();
new Any( metadataBuildingContext, tbl ).accept( vv );
new Array( metadataBuildingContext, rootClass ).accept( vv );
new Bag( metadataBuildingContext, rootClass ).accept( vv );
new Component( metadataBuildingContext, rootClass ).accept( vv );
new DependantValue( metadataBuildingContext, tbl, null ).accept( vv );
new IdentifierBag( metadataBuildingContext, rootClass ).accept( vv );
new List( metadataBuildingContext, rootClass ).accept( vv );
new ManyToOne( metadataBuildingContext, tbl ).accept( vv );
new Map( metadataBuildingContext, rootClass ).accept( vv );
new OneToMany( metadataBuildingContext, rootClass ).accept( vv );
new OneToOne( metadataBuildingContext, tbl, rootClass ).accept( vv );
new PrimitiveArray( metadataBuildingContext, rootClass ).accept( vv );
new Set( metadataBuildingContext, rootClass ).accept( vv );
new SimpleValue( metadataBuildingContext ).accept( vv );
}
代码示例来源:origin: ManyDesigns/Portofino
Bag set = new Bag(mappings, clazzOne);
set.setLazy(LAZY);
set.setRole(relationship.getToTable().getActualEntityName()+"."+relationship.getActualManyPropertyName());
set.setCollectionTable(clazzMany.getTable());
OneToMany oneToMany = new OneToMany(mappings, set.getOwner());
set.setElement(oneToMany);
set.setSorted(false);
set.setFetchMode(FetchMode.DEFAULT);
dv.setTypeName(null);
dv.setNullable(false);
set.setKey(dv);
} else {
set.setReferencedPropertyName(m2o.getReferencedPropertyName());
KeyValue keyVal = (KeyValue) set.getOwner().getReferencedProperty(m2o.getReferencedPropertyName()).getValue();
set.setKey(keyVal);
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
public CollectionType getDefaultCollectionType() {
return getMappings().getTypeResolver()
.getTypeFactory()
.bag( getRole(), getReferencedPropertyName(), isEmbedded() );
}
代码示例来源:origin: hibernate/hibernate
public CollectionType getDefaultCollectionType() {
return TypeFactory.bag( getRole(), getReferencedPropertyName(), isEmbedded() );
}
代码示例来源:origin: org.hibernate/hibernate-annotations
protected Collection createCollection(PersistentClass persistentClass) {
return new org.hibernate.mapping.Bag( persistentClass );
}
}
代码示例来源:origin: hibernate/hibernate-orm
collectionBinding = new Bag( sourceDocument, entityDescriptor );
bindCollectionMetadata( sourceDocument, attributeSource, collectionBinding );
代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all
protected Collection createCollection(PersistentClass persistentClass) {
return new org.hibernate.mapping.Bag( persistentClass );
}
}
代码示例来源:origin: org.hibernate.orm/hibernate-core
@Override
protected Collection createCollection(PersistentClass persistentClass) {
return new org.hibernate.mapping.Bag( getBuildingContext(), persistentClass );
}
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
protected Collection createCollection(PersistentClass persistentClass) {
return new org.hibernate.mapping.Bag( getMappings(), persistentClass );
}
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
protected Collection createCollection(PersistentClass persistentClass) {
return new org.hibernate.mapping.Bag( getMappings(), persistentClass );
}
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
public Collection create(Element node, String path, PersistentClass owner,
Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
Bag bag = new Bag( mappings, owner );
bindCollection( node, bag, owner.getEntityName(), path, mappings, inheritedMetas );
return bag;
}
};
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
public Collection create(Element node, String path, PersistentClass owner,
Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
Bag bag = new Bag( mappings, owner );
bindCollection( node, bag, owner.getEntityName(), path, mappings, inheritedMetas );
return bag;
}
};
代码示例来源:origin: org.hibernate.orm/hibernate-core
collectionBinding = new Bag( sourceDocument, entityDescriptor );
bindCollectionMetadata( sourceDocument, attributeSource, collectionBinding );
内容来源于网络,如有侵权,请联系作者删除!