本文整理汇总了Java中javax.persistence.OrderColumn类的典型用法代码示例。如果您正苦于以下问题:Java OrderColumn类的具体用法?Java OrderColumn怎么用?Java OrderColumn使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OrderColumn类属于javax.persistence包,在下文中一共展示了OrderColumn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testLengthAnnotation
import javax.persistence.OrderColumn; //导入依赖的package包/类
public void testLengthAnnotation() throws Exception {
final AnnotatedElementFactory aef = new DualAnnotatedElementFactory();
final ParameterizedAnnotatedElement o2m = aef
.getAnnotatedElement(HJIII73Parent.class
.getMethod("getHJIII73ChildOneToMany"));
final ParameterizedAnnotatedElement m2m = aef
.getAnnotatedElement(HJIII73Parent.class
.getMethod("getHJIII73ChildManyToMany"));
Assert.assertNotNull(o2m.getAnnotation(OrderColumn.class));
Assert.assertTrue(o2m.getAnnotation(OrderColumn.class).name().length() > 0);
Assert.assertNotNull(m2m.getAnnotation(OrderColumn.class));
Assert.assertEquals("ORDNUNG", m2m.getAnnotation(OrderColumn.class)
.name());
}
示例2: buildColumnFromAnnotation
import javax.persistence.OrderColumn; //导入依赖的package包/类
/**
* JPA 2 {@link OrderColumn @OrderColumn} processing.
*
* @param ann The OrderColumn annotation instance
* @param propertyHolder Information about the property
* @param inferredData Yeah, right. Uh...
* @param secondaryTables Any secondary tables available.
* @param mappings The mappings being built.
*
* @return The index column
*/
public static IndexColumn buildColumnFromAnnotation(
OrderColumn ann,
PropertyHolder propertyHolder,
PropertyData inferredData,
Map<String, Join> secondaryTables,
Mappings mappings) {
final IndexColumn column;
if ( ann != null ) {
final String sqlType = BinderHelper.isEmptyAnnotationValue( ann.columnDefinition() ) ? null : ann.columnDefinition();
final String name = BinderHelper.isEmptyAnnotationValue( ann.name() ) ? inferredData.getPropertyName() + "_ORDER" : ann.name();
//TODO move it to a getter based system and remove the constructor
// The JPA OrderColumn annotation defines no table element...
// column = new IndexColumn(
// false, sqlType, 0, 0, 0, name, ann.nullable(),
// false, ann.insertable(), ann.updatable(), ann.table(),
// secondaryTables, propertyHolder, mappings
// );
column = new IndexColumn(
false, sqlType, 0, 0, 0, name, ann.nullable(),
false, ann.insertable(), ann.updatable(), /*ann.table()*/null,
secondaryTables, propertyHolder, mappings
);
}
else {
column = new IndexColumn(
true, null, 0, 0, 0, null, true,
false, true, true, null, null, propertyHolder, mappings
);
}
return column;
}
示例3: getOrderColumn
import javax.persistence.OrderColumn; //导入依赖的package包/类
/**
* Adds an @OrderColumn annotation to the specified annotationList if the specified element
* contains an order-column sub-element. This should only be the case for element-collection,
* many-to-many, or one-to-many associations.
*/
private void getOrderColumn(List<Annotation> annotationList, Element element) {
Element subelement = element != null ? element.element( "order-column" ) : null;
if ( subelement != null ) {
AnnotationDescriptor ad = new AnnotationDescriptor( OrderColumn.class );
copyStringAttribute( ad, subelement, "name", false );
copyBooleanAttribute( ad, subelement, "nullable" );
copyBooleanAttribute( ad, subelement, "insertable" );
copyBooleanAttribute( ad, subelement, "updatable" );
copyStringAttribute( ad, subelement, "column-definition", false );
annotationList.add( AnnotationFactory.create( ad ) );
}
}
示例4: getChildren
import javax.persistence.OrderColumn; //导入依赖的package包/类
@Override
@OneToMany(targetEntity = MCRCategoryImpl.class,
cascade = {
CascadeType.ALL },
mappedBy = "parent")
@OrderColumn(name = "positionInParent")
@Access(AccessType.FIELD)
public List<MCRCategory> getChildren() {
return super.getChildren();
}
示例5: getData
import javax.persistence.OrderColumn; //导入依赖的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;
}
示例6: getCriterionResults
import javax.persistence.OrderColumn; //导入依赖的package包/类
/**
* @return the questionResults
*/
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "participationVO")
@IndexColumn(name = "PK")
@OrderColumn(name = "PK")
@Fetch(FetchMode.SELECT)
public List<CriterionResultVO> getCriterionResults() {
return criterionResults;
}
示例7: getPK
import javax.persistence.OrderColumn; //导入依赖的package包/类
/**
* getter pk
*
* @hibernate.id generator-class="native"
*/
@Id
@TableGenerator(name = "tbsed", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@OrderColumn
public P getPK() {
return this.pk;
}
示例8: CollectionProperty
import javax.persistence.OrderColumn; //导入依赖的package包/类
/**
* Creates a new collection property.
*
* @param sourceClass
* the description of the current inspected class that contains this property
* @param attribute
* accessor to the represented attribute
* @param override
* the configured assocation override
*/
public CollectionProperty(final EntityClass<?> sourceClass, final AttributeAccessor attribute,
final AssociationOverride override) {
super(sourceClass, attribute, override, 0);
// Read a potentially defined order column
final OrderColumn orderColumnDef = attribute.getAnnotation(OrderColumn.class);
this.orderColumn = orderColumnDef == null ? null
: getTable().resolveColumn(
orderColumnDef.name().length() == 0 ? attribute.getName() + "_ORDER" : orderColumnDef.name());
}
示例9: getTracks
import javax.persistence.OrderColumn; //导入依赖的package包/类
@OneToMany(mappedBy="recording", cascade=CascadeType.ALL)
@OrderColumn(name="index_number")
public List<Track> getTracks() {
if (tracks == null || tracks.length == 0) {
return new ArrayList<Track>();
}
return Arrays.asList(tracks);
}
示例10: getKostZuweisungen
import javax.persistence.OrderColumn; //导入依赖的package包/类
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "rechnungs_pos_fk")
@OrderColumn(name = "index")
public List<KostZuweisungDO> getKostZuweisungen()
{
return kostZuweisungen;
}
示例11: getKostZuweisungen
import javax.persistence.OrderColumn; //导入依赖的package包/类
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "eingangsrechnungs_pos_fk")
@OrderColumn(name = "index")
@Override
public List<KostZuweisungDO> getKostZuweisungen()
{
return this.kostZuweisungen;
}
示例12: getTasks
import javax.persistence.OrderColumn; //导入依赖的package包/类
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = TableConstants.BRANCH_TASK_TABLE, joinColumns = @JoinColumn(name = FieldConstants.BRANCH_ID) , inverseJoinColumns = @JoinColumn(name = FieldConstants.TASK_ID) )
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@LazyCollection(LazyCollectionOption.TRUE)
@OrderColumn(name = FieldConstants.RANK)
public List<Task> getTasks() {
return tasks;
}
示例13: getSlides
import javax.persistence.OrderColumn; //导入依赖的package包/类
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = TableConstants.TASK_SLIDE_TABLE, joinColumns = @JoinColumn(name = FieldConstants.TASK_ID), inverseJoinColumns = @JoinColumn(name = FieldConstants.SLIDE_ID))
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@LazyCollection(LazyCollectionOption.TRUE)
@OrderColumn(name = FieldConstants.RANK)
public List<Slide> getSlides() {
return slides;
}
示例14: getBranches
import javax.persistence.OrderColumn; //导入依赖的package包/类
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = TableConstants.PACK_BRANCH_TABLE, joinColumns = @JoinColumn(name = FieldConstants.PACK_ID), inverseJoinColumns = @JoinColumn(name = FieldConstants.BRANCH_ID))
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@LazyCollection(LazyCollectionOption.TRUE)
@OrderColumn(name = FieldConstants.RANK)
public List<Branch> getBranches() {
return branches;
}
示例15: getEvents
import javax.persistence.OrderColumn; //导入依赖的package包/类
@OneToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = TableConstants.TEST_EVENT_TABLE, joinColumns = @JoinColumn(name = FieldConstants.TEST_ID), inverseJoinColumns = @JoinColumn(name = FieldConstants.EVENT_ID))
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@LazyCollection(LazyCollectionOption.TRUE)
@OrderColumn(name = FieldConstants.RANK)
public List<Event> getEvents() {
return events;
}