项目:lams
文件:JPAOverriddenAnnotationReader.java
private void getMapKeyColumn(List<Annotation> annotationList,Element element) {
Element subelement = element != null ? element.element( "map-key-column" ) : null;
if ( subelement != null ) {
AnnotationDescriptor ad = new AnnotationDescriptor( MapKeyColumn.class );
copyStringAttribute( ad,subelement,"name",false );
copyBooleanAttribute( ad,"unique" );
copyBooleanAttribute( ad,"nullable" );
copyBooleanAttribute( ad,"insertable" );
copyBooleanAttribute( ad,"updatable" );
copyStringAttribute( ad,"column-deFinition",false );
copyStringAttribute( ad,"table",false );
copyIntegerAttribute( ad,"length" );
copyIntegerAttribute( ad,"precision" );
copyIntegerAttribute( ad,"scale" );
annotationList.add( AnnotationFactory.create( ad ) );
}
}
项目:mycore
文件:MCRUser.java
/**
* @return the attributes
*/
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "MCRUserAttr",joinColumns = @JoinColumn(name = "id"),indexes = { @Index(name = "MCRUserAttributes",columnList = "name,value"),@Index(name = "MCRUserValues",columnList = "value") })
@MapKeyColumn(name = "name",length = 128)
@Column(name = "value",length = 255)
public Map<String,String> getAttributes() {
return attributes;
}
项目:mycore
文件:MCRJob.java
/**
* Returns all set parameters of the job.
*
* @return the job parameters
*/
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "MCRJobParameter",joinColumns = @JoinColumn(name = "jobID"))
@MapKeyColumn(name = "paramKey",length = 128)
@Column(name = "paramValue",String> getParameters() {
return parameters;
}
项目:LSChatServer
文件:LSPayload.java
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "User_Message_Attr",joinColumns = {
@JoinColumn(referencedColumnName = "Id",name = "PayloadId") })
@Column(name = "Value")
@MapKeyColumn(name = "Key")
public Map<String,String> getAttr() {
return attr;
}
@ElementCollection
@CollectionTable(name = "bucket_object_version_tags",foreignKey = @ForeignKey(name = RdbmsConstants.PREFIX + "bucket_object_version_tags_fk_bucket_object_version"),joinColumns = {
@JoinColumn(name = "bucket_id",referencedColumnName = "bucket_id"),@JoinColumn(name = "object_name",referencedColumnName = "object_name"),@JoinColumn(name = "version_uuid",referencedColumnName = "version_uuid")
})
@MapKeyColumn(name = "tag",nullable = false)
@Column(name = "value",nullable = false)
public Map<String,String> getTags() {
return tags;
}
项目:blaze-storage
文件:Account.java
@ElementCollection
@CollectionTable(name = "account_tags",foreignKey = @ForeignKey(name = RdbmsConstants.PREFIX + "account_tags_fk_user_account"),joinColumns = {
@JoinColumn(name = "account_id",referencedColumnName = "id")
})
@MapKeyColumn(name = "tag",String> getTags() {
return tags;
}
项目:blaze-storage
文件:Storage.java
@ElementCollection
@CollectionTable(name = "storage_tags",foreignKey = @ForeignKey(name = RdbmsConstants.PREFIX + "storage_tags_fk_storage"),joinColumns = {
@JoinColumn(name = "owner_id",referencedColumnName = "owner_id"),@JoinColumn(name = "storage_name",referencedColumnName = "name")
})
@MapKeyColumn(name = "tag",String> getTags() {
return tags;
}
项目:org.fastnate
文件:MapProperty.java
private static GeneratorColumn buildKeyColumn(final GeneratorTable table,final MapKeyColumn keyColumn,final String defaultKeyColumn) {
if (keyColumn != null && keyColumn.name().length() > 0) {
return table.resolveColumn(keyColumn.name());
}
return table.resolveColumn(defaultKeyColumn);
}
项目:org.fastnate
文件:MapProperty.java
/**
* Creates a new map property.
*
* @param sourceClass
* the description of the current inspected class that contains this property
* @param attribute
* the accessor of the represented attribute
* @param override
* the configured assocation override
*/
@SuppressWarnings("unchecked")
public MapProperty(final EntityClass<?> sourceClass,final AttributeAccessor attribute,final AssociationOverride override) {
super(sourceClass,attribute,override,1);
// Initialize the key description
final MapKeyClass keyClassAnnotation = attribute.getAnnotation(MapKeyClass.class);
this.keyClass = getPropertyArgument(attribute,keyClassAnnotation != null ? keyClassAnnotation.value() : (Class<K>) void.class,0);
this.keyEntityClass = sourceClass.getContext().getDescription(this.keyClass);
if (getMappedBy() != null) {
this.keyConverter = null;
this.keyColumn = null;
} else {
if (this.keyEntityClass != null) {
// Entity key
this.keyConverter = null;
this.keyColumn = buildKeyColumn(getTable(),attribute.getAnnotation(MapKeyJoinColumn.class),attribute.getName() + "_KEY");
} else {
// Primitive key
this.keyConverter = PrimitiveProperty.createConverter(attribute,this.keyClass,true);
this.keyColumn = buildKeyColumn(getTable(),attribute.getAnnotation(MapKeyColumn.class),attribute.getName() + "_KEY");
}
}
}
项目:stdlib
文件:ResourceInstanceEntity.java
项目:Jouve-Project
文件:I18NLabel.java
@ElementCollection(targetClass = String.class)
@CollectionTable(name = "I18NLabel_Values")
@MapKeyColumn(name="locale",length = 128)
@MapKeyClass(Locale.class)
@Column(name="value",length = 10 * 1024)
public Map<Locale,String> getValues() {
return values;
}
项目:Jouve-Project
文件:RecordCollection.java
@ElementCollection
@CollectionTable(name = "RecordCollection_Locales",joinColumns = @JoinColumn(name = "recordCollection_id"))
@MapKeyColumn(name = "locale",length = 128)
@MapKeyClass(Locale.class)
public Set<Locale> getLocales() {
return locales;
}
public MapKeyColumnDelegator(MapKeyColumn column) {
this.column = column;
}
项目:elide
文件:MapColorShape.java
@ElementCollection
@MapKeyColumn(name = "color")
@Column(name = "shape")
public Map<Color,Shape> getColorShapeMap() {
return colorShapeMap;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。