javax.persistence.OrderBy#org.hibernate.annotations.Fetch源码实例Demo

下面列出了javax.persistence.OrderBy#org.hibernate.annotations.Fetch 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: pikatimer   文件: TimingLocation.java
@OneToMany(mappedBy="timingLocation",fetch = FetchType.EAGER)
@Fetch(FetchMode.SELECT)
@Cascade(CascadeType.DELETE)
public List<TimingLocationInput> getInputs() {
    //return associatedSplits.sorted((Split o1, Split o2) -> o1.getPosition().compareTo(o2.getPosition()));
    return timingInputList;
}
 
源代码2 项目: pikatimer   文件: RaceAwards.java
@ElementCollection(fetch = FetchType.EAGER)
@OneToMany(mappedBy="raceAward",cascade={CascadeType.PERSIST, CascadeType.REMOVE},fetch = FetchType.EAGER)
@Fetch(FetchMode.SELECT)
@OrderColumn(name = "category_priority")
public List<AwardCategory> getAwardCategories(){
    return awardCategories;
}
 
源代码3 项目: pikatimer   文件: Race.java
@OneToMany(mappedBy="race",cascade={CascadeType.PERSIST, CascadeType.REMOVE},fetch = FetchType.EAGER)
@OrderBy("split_seq_number")
@Fetch(FetchMode.SELECT)
public List<Split> getSplits() {
    return raceSplitList;
    //return raceSplits.sorted((Split o1, Split o2) -> o1.getPosition().compareTo(o2.getPosition()));
}
 
源代码4 项目: scheduling   文件: JobData.java
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "jobData")
@Fetch(FetchMode.SELECT)
@BatchSize(size = 10)
@MapKey(name = "jobId")
@PrimaryKeyJoinColumn(name = "JOB_ID")
public List<JobContent> getJobContent() {
    return jobContent;
}
 
源代码5 项目: SeaCloudsPlatform   文件: GuaranteeTerm.java
@Override
@Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
@OneToMany(targetEntity = Policy.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "guarantee_term_id", referencedColumnName = "id", nullable = true)
public List<IPolicy> getPolicies() {
    return policies;
}
 
源代码6 项目: SeaCloudsPlatform   文件: GuaranteeTerm.java
@Override
@Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
@OneToMany(targetEntity = Violation.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinColumn(name = "guarantee_term_id", referencedColumnName = "id", nullable = true)
public List<IViolation> getViolations() {
    return violations;
}
 
源代码7 项目: SeaCloudsPlatform   文件: GuaranteeTerm.java
@Override
@Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
@OneToMany(targetEntity = Penalty.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinColumn(name = "guarantee_term_id", referencedColumnName = "id", nullable = true)
public List<IPenalty> getPenalties() {
    return penalties;
}
 
源代码8 项目: SeaCloudsPlatform   文件: Violation.java
@Override
@Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
@OneToMany(targetEntity = Breach.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "violation_id", referencedColumnName = "id", nullable = true)
public List<IBreach> getBreaches() {
    return breaches;
}
 
源代码9 项目: lams   文件: AnnotationBinder.java
protected static void defineFetchingStrategy(ToOne toOne, XProperty property) {
	LazyToOne lazy = property.getAnnotation( LazyToOne.class );
	Fetch fetch = property.getAnnotation( Fetch.class );
	ManyToOne manyToOne = property.getAnnotation( ManyToOne.class );
	OneToOne oneToOne = property.getAnnotation( OneToOne.class );
	FetchType fetchType;
	if ( manyToOne != null ) {
		fetchType = manyToOne.fetch();
	}
	else if ( oneToOne != null ) {
		fetchType = oneToOne.fetch();
	}
	else {
		throw new AssertionFailure(
				"Define fetch strategy on a property not annotated with @OneToMany nor @OneToOne"
		);
	}
	if ( lazy != null ) {
		toOne.setLazy( !( lazy.value() == LazyToOneOption.FALSE ) );
		toOne.setUnwrapProxy( ( lazy.value() == LazyToOneOption.NO_PROXY ) );
	}
	else {
		toOne.setLazy( fetchType == FetchType.LAZY );
		toOne.setUnwrapProxy( false );
	}
	if ( fetch != null ) {
		if ( fetch.value() == org.hibernate.annotations.FetchMode.JOIN ) {
			toOne.setFetchMode( FetchMode.JOIN );
			toOne.setLazy( false );
			toOne.setUnwrapProxy( false );
		}
		else if ( fetch.value() == org.hibernate.annotations.FetchMode.SELECT ) {
			toOne.setFetchMode( FetchMode.SELECT );
		}
		else if ( fetch.value() == org.hibernate.annotations.FetchMode.SUBSELECT ) {
			throw new AnnotationException( "Use of FetchMode.SUBSELECT not allowed on ToOne associations" );
		}
		else {
			throw new AssertionFailure( "Unknown FetchMode: " + fetch.value() );
		}
	}
	else {
		toOne.setFetchMode( getFetchMode( fetchType ) );
	}
}
 
源代码10 项目: lams   文件: CollectionBinder.java
private void defineFetchingStrategy() {
	LazyCollection lazy = property.getAnnotation( LazyCollection.class );
	Fetch fetch = property.getAnnotation( Fetch.class );
	OneToMany oneToMany = property.getAnnotation( OneToMany.class );
	ManyToMany manyToMany = property.getAnnotation( ManyToMany.class );
	ElementCollection elementCollection = property.getAnnotation( ElementCollection.class );
	ManyToAny manyToAny = property.getAnnotation( ManyToAny.class );
	FetchType fetchType;
	if ( oneToMany != null ) {
		fetchType = oneToMany.fetch();
	}
	else if ( manyToMany != null ) {
		fetchType = manyToMany.fetch();
	}
	else if ( elementCollection != null ) {
		fetchType = elementCollection.fetch();
	}
	else if ( manyToAny != null ) {
		fetchType = FetchType.LAZY;
	}
	else {
		throw new AssertionFailure(
				"Define fetch strategy on a property not annotated with @ManyToOne nor @OneToMany nor @CollectionOfElements"
		);
	}
	if ( lazy != null ) {
		collection.setLazy( !( lazy.value() == LazyCollectionOption.FALSE ) );
		collection.setExtraLazy( lazy.value() == LazyCollectionOption.EXTRA );
	}
	else {
		collection.setLazy( fetchType == FetchType.LAZY );
		collection.setExtraLazy( false );
	}
	if ( fetch != null ) {
		if ( fetch.value() == org.hibernate.annotations.FetchMode.JOIN ) {
			collection.setFetchMode( FetchMode.JOIN );
			collection.setLazy( false );
		}
		else if ( fetch.value() == org.hibernate.annotations.FetchMode.SELECT ) {
			collection.setFetchMode( FetchMode.SELECT );
		}
		else if ( fetch.value() == org.hibernate.annotations.FetchMode.SUBSELECT ) {
			collection.setFetchMode( FetchMode.SELECT );
			collection.setSubselectLoadable( true );
			collection.getOwner().setSubselectLoadableCollections( true );
		}
		else {
			throw new AssertionFailure( "Unknown FetchMode: " + fetch.value() );
		}
	}
	else {
		collection.setFetchMode( AnnotationBinder.getFetchMode( fetchType ) );
	}
}
 
源代码11 项目: pikatimer   文件: Race.java
@OneToMany(mappedBy="race",cascade={CascadeType.PERSIST, CascadeType.REMOVE},fetch = FetchType.EAGER)
@Fetch(FetchMode.SELECT)
public List<Wave> getWaves() {
    return raceWavesList;
}
 
源代码12 项目: pikatimer   文件: Race.java
@OneToMany(mappedBy="race",cascade={CascadeType.PERSIST, CascadeType.REMOVE},fetch = FetchType.EAGER)
@Fetch(FetchMode.SELECT)
public List<RaceReport> getRaceReports() {
    return raceReportsList;
}
 
源代码13 项目: pikatimer   文件: RaceReport.java
@OneToMany(mappedBy="raceReport",cascade={CascadeType.PERSIST, CascadeType.REMOVE},fetch = FetchType.LAZY)
@Fetch(FetchMode.SELECT)
public List<RaceOutputTarget> getRaceOutputTargets() {
    return raceOutputTargetList;
}
 
源代码14 项目: SeaCloudsPlatform   文件: ServiceProperties.java
@Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
@OneToMany(targetEntity = Variable.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "service_properties_id", referencedColumnName = "id", nullable = true)
public List<IVariable> getVariableSet() {
    return variableSet;
}
 
源代码15 项目: SeaCloudsPlatform   文件: Provider.java
@Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
@OneToMany(targetEntity = Template.class, fetch = FetchType.EAGER)
@JoinColumn(name = "provider_id", referencedColumnName = "id", nullable = true)
public List<ITemplate> getTemplates() {
    return templates;
}
 
源代码16 项目: SeaCloudsPlatform   文件: Agreement.java
@Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
@OneToMany(targetEntity = ServiceProperties.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "agreement_id", referencedColumnName = "id", nullable = true)
public List<IServiceProperties> getServiceProperties() {
    return serviceProperties;
}
 
源代码17 项目: SeaCloudsPlatform   文件: Agreement.java
@Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
@OneToMany(targetEntity = GuaranteeTerm.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "agreement_id", referencedColumnName = "id", nullable = true)
public List<IGuaranteeTerm> getGuaranteeTerms() {
    return guaranteeTerms;
}