本文整理汇总了Java中javax.persistence.CollectionTable类的典型用法代码示例。如果您正苦于以下问题:Java CollectionTable类的具体用法?Java CollectionTable怎么用?Java CollectionTable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CollectionTable类属于javax.persistence包,在下文中一共展示了CollectionTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCollectionTable
import javax.persistence.CollectionTable; //导入依赖的package包/类
private void getCollectionTable(List<Annotation> annotationList, Element element, XMLContext.Default defaults) {
Element subelement = element != null ? element.element( "collection-table" ) : null;
if ( subelement != null ) {
AnnotationDescriptor annotation = new AnnotationDescriptor( CollectionTable.class );
copyStringAttribute( annotation, subelement, "name", false );
copyStringAttribute( annotation, subelement, "catalog", false );
if ( StringHelper.isNotEmpty( defaults.getCatalog() )
&& StringHelper.isEmpty( (String) annotation.valueOf( "catalog" ) ) ) {
annotation.setValue( "catalog", defaults.getCatalog() );
}
copyStringAttribute( annotation, subelement, "schema", false );
if ( StringHelper.isNotEmpty( defaults.getSchema() )
&& StringHelper.isEmpty( (String) annotation.valueOf( "schema" ) ) ) {
annotation.setValue( "schema", defaults.getSchema() );
}
JoinColumn[] joinColumns = getJoinColumns( subelement, false );
if ( joinColumns.length > 0 ) {
annotation.setValue( "joinColumns", joinColumns );
}
buildUniqueConstraints( annotation, subelement );
buildIndex( annotation, subelement );
annotationList.add( AnnotationFactory.create( annotation ) );
}
}
示例2: getLabels
import javax.persistence.CollectionTable; //导入依赖的package包/类
@Override
@ElementCollection(fetch = FetchType.LAZY)
@CollectionTable(name = "MCRCategoryLabels",
joinColumns = @JoinColumn(name = "category"),
uniqueConstraints = {
@UniqueConstraint(columnNames = { "category", "lang" }) })
public Set<MCRLabel> getLabels() {
return super.getLabels();
}
示例3: buildTableName
import javax.persistence.CollectionTable; //导入依赖的package包/类
/**
* Builds the name of the table of the association for the given field.
*
* @param attribute
* the inspected field
* @param override
* contains optional override options
* @param joinTable
* the optional join table
* @param collectionTable
* the optional metadata of the table
* @param defaultTableName
* the default name for the table
* @return the table name
*/
protected static String buildTableName(final AttributeAccessor attribute, final AssociationOverride override,
final JoinTable joinTable, final CollectionTable collectionTable, final String defaultTableName) {
if (override != null) {
final JoinTable joinTableOverride = override.joinTable();
if (joinTableOverride != null && joinTableOverride.name().length() > 0) {
return joinTableOverride.name();
}
}
if (joinTable != null && joinTable.name().length() > 0) {
return joinTable.name();
}
if (collectionTable != null && collectionTable.name().length() > 0) {
return collectionTable.name();
}
return defaultTableName;
}
示例4: getParameters
import javax.persistence.CollectionTable; //导入依赖的package包/类
@ElementCollection
@MapKeyColumn(name = "parameters_idx")
@Column(name = "parameters_elt")
@CollectionTable(name = "info_parameters")
public Map<String, String> getParameters() {
return parameters;
}
示例5: getAttributes
import javax.persistence.CollectionTable; //导入依赖的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;
}
示例6: getParameters
import javax.persistence.CollectionTable; //导入依赖的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;
}
示例7: getOptions
import javax.persistence.CollectionTable; //导入依赖的package包/类
/**
* 获取可选项
*
* @return 可选项
*/
@JsonProperty
@NotEmpty
@ElementCollection
@CollectionTable(name = "xx_attribute_option")
public List<String> getOptions() {
return options;
}
示例8: getAttributes
import javax.persistence.CollectionTable; //导入依赖的package包/类
/**
* 获取属性
*
* @return 属性
*/
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "xx_plugin_config_attribute")
@MapKeyColumn(name = "name", length = 100)
public Map<String, String> getAttributes() {
return attributes;
}
示例9: getProductImages
import javax.persistence.CollectionTable; //导入依赖的package包/类
/**
* 获取商品图片
*
* @return 商品图片
*/
@Valid
@ElementCollection
@CollectionTable(name = "xx_product_product_image")
public List<ProductImage> getProductImages() {
return productImages;
}
示例10: getAuthorities
import javax.persistence.CollectionTable; //导入依赖的package包/类
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "UserPrincipal_Authority", joinColumns = {
@JoinColumn(referencedColumnName = "Id", name = "UserId") })
@Override
public Set<UserAuthority> getAuthorities() {
return this.authorities;
}
示例11: getCategories
import javax.persistence.CollectionTable; //导入依赖的package包/类
@Override
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name="Categories")
public List<String> getCategories()
{
return this.categories;
}
示例12: getAttr
import javax.persistence.CollectionTable; //导入依赖的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;
}
示例13: getAssociates
import javax.persistence.CollectionTable; //导入依赖的package包/类
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "User_Associate", joinColumns = {
@JoinColumn(referencedColumnName = "Id", name = "UserId") })
@Column(name = "name")
public Set<String> getAssociates() {
return associates;
}
示例14: getData
import javax.persistence.CollectionTable; //导入依赖的package包/类
/**
* @return data
*/
@ElementCollection(fetch=FetchType.LAZY)
@CollectionTable(name = "patient_kpi_validation_data", joinColumns = @JoinColumn(name = "patient_kpi_id"))
@ForeignKey(name="fk_patient_kpi_data_pat_kpi_id")
@OrderColumn(name="idx")
public List<BigDecimal> getData() {
return this.data;
}
示例15: getTags
import javax.persistence.CollectionTable; //导入依赖的package包/类
/**
* @return tags
*/
@ElementCollection
@CollectionTable(name="question_type_tag")
@Column(name="tag", length=255, nullable = false)
@JoinColumn(name="question_type_id", nullable=false)
@ForeignKey(name = "fk_qtt_question_type_id")
public List<String> getTags() {
return this.tags;
}