当前位置: 首页>>代码示例>>Java>>正文


Java OrderColumn类代码示例

本文整理汇总了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());
	}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:18,代码来源:HJIII73Test.java

示例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;
	}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:43,代码来源:IndexColumn.java

示例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 ) );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:JPAOverriddenAnnotationReader.java

示例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();
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:11,代码来源:MCRCategoryImpl.java

示例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;
}
 
开发者ID:MobileManAG,项目名称:Project-H-Backend,代码行数:11,代码来源:PatientKeyPerformanceIndicatorValidation.java

示例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;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:11,代码来源:ParticipationVO.java

示例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;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:13,代码来源:AbstractBaseVO.java

示例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());
}
 
开发者ID:liefke,项目名称:org.fastnate,代码行数:21,代码来源:CollectionProperty.java

示例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);
}
 
开发者ID:LearningTree,项目名称:TicketManorJava,代码行数:9,代码来源:MusicRecording.java

示例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;
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:8,代码来源:RechnungsPositionDO.java

示例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;
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:9,代码来源:EingangsrechnungsPositionDO.java

示例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;
}
 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:9,代码来源:Branch.java

示例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;
}
 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:9,代码来源:Task.java

示例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;
}
 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:9,代码来源:Pack.java

示例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;
}
 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:9,代码来源:Test.java


注:本文中的javax.persistence.OrderColumn类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。