本文整理匯總了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);
}