Java 类javax.persistence.MapKeyColumn 实例源码

项目: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, subelement, "unique" );
        copyBooleanAttribute( ad, subelement, "nullable" );
        copyBooleanAttribute( ad, subelement, "insertable" );
        copyBooleanAttribute( ad, subelement, "updatable" );
        copyStringAttribute( ad, subelement, "column-definition", false );
        copyStringAttribute( ad, subelement, "table", false );
        copyIntegerAttribute( ad, subelement, "length" );
        copyIntegerAttribute( ad, subelement, "precision" );
        copyIntegerAttribute( ad, subelement, "scale" );
        annotationList.add( AnnotationFactory.create( ad ) );
    }
}
项目:metacat    文件:Info.java   
@ElementCollection
@MapKeyColumn(name = "parameters_idx")
@Column(name = "parameters_elt")
@CollectionTable(name = "info_parameters")
public Map<String, String> getParameters() {
    return parameters;
}
项目: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", length = 255)
public Map<String, String> getParameters() {
    return parameters;
}
项目:my-paper    文件:PluginConfig.java   
/**
 * 获取属性
 * 
 * @return 属性
 */
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "xx_plugin_config_attribute")
@MapKeyColumn(name = "name", length = 100)
public Map<String, String> getAttributes() {
    return attributes;
}
项目: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;
}
项目:blaze-storage    文件:BucketObjectVersion.java   
@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", nullable = false)
@Column(name = "value", nullable = false)
public Map<String, 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", nullable = false)
@Column(name = "value", nullable = false)
public Map<String, 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   
@EagerFetch
@ElementCollection
@JoinTable(name = "resource_instance_metadata", joinColumns = @JoinColumn(name = "resource_instance_id"))
@MapKeyColumn(name = "meta_name")
@Column(name = "meta_val")
public Map<String, String> getMetadata()
{
    return metadata;
}
项目: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;
}
项目:lams    文件:MapKeyColumnDelegator.java   
public MapKeyColumnDelegator(MapKeyColumn column) {
    this.column = column;
}
项目:elide    文件:MapColorShape.java   
@ElementCollection
@MapKeyColumn(name = "color")
@Column(name = "shape")
public Map<Color, Shape> getColorShapeMap() {
    return colorShapeMap;
}