本文整理了Java中org.hibernate.mapping.Property.isSynthetic()
方法的一些代码示例,展示了Property.isSynthetic()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.isSynthetic()
方法的具体详情如下:
包路径:org.hibernate.mapping.Property
类名称:Property
方法名:isSynthetic
[英]Does this property represent a synthetic property? A synthetic property is one we create during metamodel binding to represent a collection of columns but which does not represent a property physically available on the entity.
[中]这个属性代表合成属性吗?合成属性是我们在元模型绑定期间创建的一个属性,用于表示列的集合,但它不表示实体上物理上可用的属性。
代码示例来源:origin: hibernate/hibernate-orm
if ( property.isSynthetic() ) {
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.ejb
/**
* Build a normal attribute.
*
* @param ownerType The descriptor of the attribute owner (aka declarer).
* @param property The Hibernate property descriptor for the attribute
* @param <X> The type of the owner
* @param <Y> The attribute type
* @return The built attribute descriptor or null if the attribute is not part of the JPA 2 model (eg backrefs)
*/
@SuppressWarnings({ "unchecked" })
public <X, Y> AttributeImplementor<X, Y> buildAttribute(AbstractManagedType<X> ownerType, Property property) {
if ( property.isSynthetic() ) {
// hide synthetic/virtual properties (fabricated by Hibernate) from the JPA metamodel.
LOG.trace("Skipping synthetic property " + ownerType.getJavaType().getName() + "(" + property.getName() + ")");
return null;
}
LOG.trace("Building attribute [" + ownerType.getJavaType().getName() + "." + property.getName() + "]");
final AttributeContext<X> attributeContext = wrap( ownerType, property );
final AttributeMetadata<X,Y> attributeMetadata =
determineAttributeMetadata( attributeContext, NORMAL_MEMBER_RESOLVER );
if (attributeMetadata.isPlural()) return buildPluralAttribute((PluralAttributeMetadata)attributeMetadata);
final SingularAttributeMetadata<X, Y> singularAttributeMetadata = (SingularAttributeMetadata<X, Y>)attributeMetadata;
final Type<Y> metaModelType = getMetaModelType(singularAttributeMetadata.getValueContext());
return new SingularAttributeImpl<X, Y>(attributeMetadata.getName(), attributeMetadata.getJavaType(), ownerType,
attributeMetadata.getMember(), false, false, property.isOptional(), metaModelType,
attributeMetadata.getPersistentAttributeType());
}
内容来源于网络,如有侵权,请联系作者删除!