本文整理匯總了Java中javax.persistence.MapKeyColumn類的典型用法代碼示例。如果您正苦於以下問題:Java MapKeyColumn類的具體用法?Java MapKeyColumn怎麽用?Java MapKeyColumn使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MapKeyColumn類屬於javax.persistence包,在下文中一共展示了MapKeyColumn類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getMapKeyColumn
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
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 ) );
}
}
示例2: getParameters
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
@ElementCollection
@MapKeyColumn(name = "parameters_idx")
@Column(name = "parameters_elt")
@CollectionTable(name = "info_parameters")
public Map<String, String> getParameters() {
return parameters;
}
示例3: getAttributes
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
/**
* @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;
}
示例4: getParameters
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
/**
* 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;
}
示例5: getAttributes
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
/**
* 獲取屬性
*
* @return 屬性
*/
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "xx_plugin_config_attribute")
@MapKeyColumn(name = "name", length = 100)
public Map<String, String> getAttributes() {
return attributes;
}
示例6: getAttr
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
@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;
}
示例7: getTags
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
@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;
}
示例8: getTags
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
@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;
}
示例9: getTags
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
@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;
}
示例10: buildKeyColumn
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
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);
}
示例11: MapProperty
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
/**
* 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");
}
}
}
示例12: getMetadata
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
@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;
}
示例13: getValues
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
@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;
}
示例14: getLocales
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
@ElementCollection
@CollectionTable(name = "RecordCollection_Locales", joinColumns = @JoinColumn(name = "recordCollection_id"))
@MapKeyColumn(name = "locale", length = 128)
@MapKeyClass(Locale.class)
public Set<Locale> getLocales() {
return locales;
}
示例15: MapKeyColumnDelegator
import javax.persistence.MapKeyColumn; //導入依賴的package包/類
public MapKeyColumnDelegator(MapKeyColumn column) {
this.column = column;
}