本文整理了Java中javax.persistence.metamodel.Metamodel.getEmbeddables()
方法的一些代码示例,展示了Metamodel.getEmbeddables()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Metamodel.getEmbeddables()
方法的具体详情如下:
包路径:javax.persistence.metamodel.Metamodel
类名称:Metamodel
方法名:getEmbeddables
[英]Return the metamodel embeddable types. Returns empty set if there are no embeddable types.
[中]返回元模型可嵌入类型。如果没有可嵌入类型,则返回空集。
代码示例来源:origin: hibernate/hibernate-orm
@Test
@TestForIssue(jiraKey = "HHH-12124")
public void testEmbeddableEquality() {
doInJPA( this::entityManagerFactory, entityManager -> {
assertTrue( entityManager.getMetamodel().getEmbeddables().contains( Company_.address.getType() ) );
assertTrue( entityManager.getMetamodel().getEmbeddables().contains( Person_.address.getType() ) );
} );
}
}
代码示例来源:origin: org.teiid.connectors/translator-jpa
@Override
public Set<EmbeddableType<?>> getEmbeddables() {
return model.getEmbeddables();
}
};
代码示例来源:origin: Blazebit/blaze-persistence
@Override
public Set<EmbeddableType<?>> getEmbeddables() {
return delegate.getEmbeddables();
}
代码示例来源:origin: SAP/olingo-jpa-processor-v4
private Map<String, IntermediateComplexType> buildComplexTypeList() throws ODataJPAModelException {
final HashMap<String, IntermediateComplexType> ctList = new HashMap<>();
for (final EmbeddableType<?> embeddable : this.jpaMetamodel.getEmbeddables()) {
final IntermediateComplexType ct = new IntermediateComplexType(nameBuilder, embeddable, this);
ctList.put(ct.internalName, ct);
}
return ctList;
}
代码示例来源:origin: org.apache.olingo/olingo-odata2-jpa-processor-core
public JPAEdmComplexType(final JPAEdmSchemaView view, final Attribute<?, ?> complexAttribute) {
super(view);
schemaView = view;
for (EmbeddableType<?> jpaEmbeddable : schemaView.getJPAMetaModel().getEmbeddables()) {
if (jpaEmbeddable.getJavaType().getName().equals(complexAttribute.getJavaType().getName())) {
nestedComplexType = jpaEmbeddable;
break;
}
}
directBuild = false;
if (nonKeyComplexList == null) {
nonKeyComplexList = new ArrayList<String>();
}
}
代码示例来源:origin: io.cronapp/olingo-odata2-jpa-processor-core
public JPAEdmComplexType(final JPAEdmSchemaView view, final Attribute<?, ?> complexAttribute) {
super(view);
schemaView = view;
for (EmbeddableType<?> jpaEmbeddable : schemaView.getJPAMetaModel().getEmbeddables()) {
if (jpaEmbeddable.getJavaType().getName().equals(complexAttribute.getJavaType().getName())) {
nestedComplexType = jpaEmbeddable;
break;
}
}
directBuild = false;
if (nonKeyComplexList == null) {
nonKeyComplexList = new ArrayList<String>();
}
}
代码示例来源:origin: sk.seges.corpis/corpis-dao-impl
private void findEmbeddableClasses() {
Metamodel metamodel = entityManager.getEntityManagerFactory().getMetamodel();
Set<EmbeddableType<?>> embeddableTypeSet = metamodel.getEmbeddables();
embedableClassSet = new HashSet<Class<?>>();
for (EmbeddableType<?> embeddableType : embeddableTypeSet) {
embedableClassSet.add(embeddableType.getJavaType());
}
}
代码示例来源:origin: org.apache.olingo/olingo-odata2-jpa-processor-core
embeddables = schemaView.getJPAMetaModel().getEmbeddables();
} else {
embeddables.add(nestedComplexType);
代码示例来源:origin: io.cronapp/olingo-odata2-jpa-processor-core
embeddables = schemaView.getJPAMetaModel().getEmbeddables();
} else {
embeddables.add(nestedComplexType);
代码示例来源:origin: org.fornax.cartridges/fornax-cartridges-sculptor-framework
/**
*
* @param path
* @param property
* @param value
* @return
*/
private Predicate preparePredicate(Path<?> path, String property, Object value) {
path = getPath(path, property);
if (value == null) {
return path.isNull();
}
// openjpa and datanucleus do not support embeddables as restriction
// directly
// TODO: verify whether this is working now
if (JpaHelper.isJpaProviderOpenJpa(getEntityManager()) ||
JpaHelper.isJpaProviderDataNucleus(getEntityManager())) {
for (ManagedType<?> embeddableType : metaModel.getEmbeddables()) {
if (embeddableType.getJavaType().equals(value.getClass())) {
return andPredicates(preparePredicates(path, embeddableType, value));
}
}
}
return preparePredicate(path, value);
}
代码示例来源:origin: katharsis-project/katharsis-framework
@Override
public void discoverElements(MetaProviderContext context) {
if (entityManagerFactory != null) {
Set<EmbeddableType<?>> embeddables = entityManagerFactory.getMetamodel().getEmbeddables();
for (EmbeddableType<?> embeddable : embeddables) {
context.getLookup().getMeta(embeddable.getJavaType(), MetaJpaDataObject.class);
}
Set<EntityType<?>> entities = entityManagerFactory.getMetamodel().getEntities();
for (EntityType<?> entity : entities) {
context.getLookup().getMeta(entity.getJavaType(), MetaJpaDataObject.class);
}
}
}
代码示例来源:origin: org.teiid.connectors/translator-jpa
for (EmbeddableType<?> embeddable:model.getEmbeddables()) {
if (embeddable.getJavaType().equals(attr.getJavaType())) {
addSingularAttributes(mf, model, embeddable, entityTable, attrPath);
代码示例来源:origin: org.teiid.connectors/translator-jpa
for (EmbeddableType<?> embeddable:model.getEmbeddables()) {
if (embeddable.getJavaType().equals(pkattr.getJavaType())) {
addSingularAttributes(mf, model, embeddable, entityTable, Collections.singletonList(pkattr.getName()));
代码示例来源:origin: odata4j/odata4j
for (EmbeddableType<?> et : mm.getEmbeddables()) {
代码示例来源:origin: org.fornax.cartridges/fornax-cartridges-sculptor-framework
for (ManagedType<?> embeddableType : getMetaModel().getEmbeddables()) {
if (embeddableType.getJavaType().equals(value.getClass())) {
return andPredicates(preparePredicates(path, embeddableType, value));
内容来源于网络,如有侵权,请联系作者删除!