本文整理汇总了Java中javax.persistence.AttributeOverride.column方法的典型用法代码示例。如果您正苦于以下问题:Java AttributeOverride.column方法的具体用法?Java AttributeOverride.column怎么用?Java AttributeOverride.column使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.persistence.AttributeOverride
的用法示例。
在下文中一共展示了AttributeOverride.column方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAttributeOverride
import javax.persistence.AttributeOverride; //导入方法依赖的package包/类
private static Column getAttributeOverride(Class<?> type, String name) {
AttributeOverride ao = type.getAnnotation(AttributeOverride.class);
if (ao != null) {
if (ao.name().equals(name)) {
return ao.column();
}
}
AttributeOverrides aos = type.getAnnotation(AttributeOverrides.class);
if (aos != null) {
for (AttributeOverride a : aos.value()) {
if (a.name().equals(name)) {
return a.column();
}
}
}
return null;
}
示例2: buildEmbeddedProperties
import javax.persistence.AttributeOverride; //导入方法依赖的package包/类
/**
* Builds the embedded properties of this property.
*
* @param targetType
* the target type
*/
protected void buildEmbeddedProperties(final Class<?> targetType) {
if (targetType.isAnnotationPresent(Embeddable.class)) {
// Determine the access style
final AccessStyle accessStyle;
final Access accessType = targetType.getAnnotation(Access.class);
if (accessType != null) {
accessStyle = AccessStyle.getStyle(accessType.value());
} else {
accessStyle = getAttribute().getAccessStyle();
}
this.embeddedProperties = new ArrayList<>();
this.requiredEmbeddedProperties = new ArrayList<>();
final Map<String, AttributeOverride> attributeOverrides = EntityClass
.getAttributeOverrides(getAttribute().getElement());
final Map<String, AssociationOverride> accociationOverrides = EntityClass
.getAccociationOverrides(getAttribute().getElement());
for (final AttributeAccessor attribute : accessStyle.getDeclaredAttributes((Class<Object>) targetType,
getAttribute().getImplementationClass())) {
final AttributeOverride attributeOveride = attributeOverrides.get(attribute.getName());
final Column columnMetadata = attributeOveride != null ? attributeOveride.column()
: attribute.getAnnotation(Column.class);
final AssociationOverride assocOverride = accociationOverrides.get(attribute.getName());
final SingularProperty<T, ?> property = buildProperty(attribute, columnMetadata, assocOverride);
if (property != null) {
this.embeddedProperties.add(property);
if (property.isRequired() && property instanceof EntityProperty) {
this.requiredEmbeddedProperties.add((EntityProperty<T, ?>) property);
}
}
}
}
}
示例3: getColumnAnnotation
import javax.persistence.AttributeOverride; //导入方法依赖的package包/类
private Column getColumnAnnotation(final AttributeAccessor attribute) {
final AttributeOverride override = this.attributeOverrides.get(attribute.getName());
return override != null ? override.column() : attribute.getAnnotation(Column.class);
}