Java Code Examples for javax.persistence.JoinColumn

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project riot, under directory /content/src/org/riotfamily/components/model/.

Source file: ContentContainer.java

  19 
vote

@ManyToOne(fetch=FetchType.LAZY,cascade=CascadeType.ALL) @JoinColumn(name="preview_version") public Content getPreviewVersion(){
  if (previewVersion == null) {
    previewVersion=new Content(this);
  }
  return previewVersion;
}
 

Example 2

From project zanata, under directory /zanata-model/src/main/java/org/zanata/model/.

Source file: HAccount.java

  19 
vote

@Cache(usage=CacheConcurrencyStrategy.READ_WRITE) @UserRoles @ManyToMany(targetEntity=HAccountRole.class) @JoinTable(name="HAccountMembership",[email protected](name="accountId"),[email protected](name="memberOf")) public Set<HAccountRole> getRoles(){
  if (roles == null) {
    roles=new HashSet<HAccountRole>();
    setRoles(roles);
  }
  return roles;
}
 

Example 3

From project zanata, under directory /zanata-model/src/main/java/org/zanata/model/.

Source file: HGlossaryTerm.java

  19 
vote

@OneToMany(cascade=CascadeType.ALL) @Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN) @IndexColumn(name="pos",base=0,nullable=false) @JoinColumn(name="glossaryTermId",nullable=false) public List<HTermComment> getComments(){
  if (comments == null) {
    comments=new ArrayList<HTermComment>();
  }
  return comments;
}
 

Example 4

From project zanata, under directory /zanata-model/src/main/java/org/zanata/model/.

Source file: HIterationGroup.java

  19 
vote

@ManyToMany @JoinTable(name="HIterationGroup_Maintainer",[email protected](name="iterationGroupId"),[email protected](name="personId")) public Set<HPerson> getMaintainers(){
  if (maintainers == null) {
    maintainers=new HashSet<HPerson>();
  }
  return maintainers;
}
 

Example 5

From project zanata, under directory /zanata-model/src/main/java/org/zanata/model/.

Source file: HIterationGroup.java

  19 
vote

@ManyToMany @JoinTable(name="HIterationGroup_ProjectIteration",[email protected](name="iterationGroupId"),[email protected](name="projectIterationId")) public Set<HProjectIteration> getProjectIterations(){
  if (projectIterations == null) {
    projectIterations=new HashSet<HProjectIteration>();
  }
  return projectIterations;
}
 

Example 6

From project zanata, under directory /zanata-model/src/main/java/org/zanata/model/.

Source file: HLocale.java

  19 
vote

@OneToMany(cascade=CascadeType.ALL) @JoinColumn(name="supportedLanguageId") public Set<HLocaleMember> getMembers(){
  if (this.members == null) {
    this.members=new HashSet<HLocaleMember>();
  }
  return this.members;
}
 

Example 7

From project zanata, under directory /zanata-model/src/main/java/org/zanata/model/.

Source file: HProject.java

  19 
vote

/** 
 * @see {@link #addMaintainer(HPerson)}
 */
@ManyToMany @JoinTable(name="HProject_Maintainer",[email protected](name="projectId"),[email protected](name="personId")) public Set<HPerson> getMaintainers(){
  if (maintainers == null) {
    maintainers=new HashSet<HPerson>();
  }
  return maintainers;
}
 

Example 8

From project zanata, under directory /zanata-model/src/main/java/org/zanata/model/.

Source file: HProject.java

  19 
vote

@ManyToMany @JoinTable(name="HProject_Locale",[email protected](name="projectId"),[email protected](name="localeId")) public Set<HLocale> getCustomizedLocales(){
  if (customizedLocales == null) {
    customizedLocales=new HashSet<HLocale>();
  }
  return customizedLocales;
}
 

Example 9

From project zanata, under directory /zanata-model/src/main/java/org/zanata/model/.

Source file: HProject.java

  19 
vote

@ManyToMany @JoinTable(name="HProject_AllowedRole",[email protected](name="projectId"),[email protected](name="roleId")) public Set<HAccountRole> getAllowedRoles(){
  if (allowedRoles == null) {
    allowedRoles=new HashSet<HAccountRole>();
  }
  return allowedRoles;
}
 

Example 10

From project zanata, under directory /zanata-model/src/main/java/org/zanata/model/.

Source file: HProjectIteration.java

  19 
vote

@ManyToMany @JoinTable(name="HIterationGroup_ProjectIteration",[email protected](name="projectIterationId"),[email protected](name="iterationGroupId")) public Set<HIterationGroup> getGroups(){
  if (groups == null) {
    groups=new HashSet<HIterationGroup>();
  }
  return groups;
}
 

Example 11

From project zanata, under directory /zanata-model/src/main/java/org/zanata/model/.

Source file: HTextFlow.java

  19 
vote

@Override @NotEmpty @Type(type="text") @AccessType("field") @CollectionOfElements(fetch=FetchType.EAGER) @JoinTable(name="HTextFlowContent",[email protected](name="text_flow_id")) @IndexColumn(name="pos",nullable=false) @Column(name="content",nullable=false) public List<String> getContents(){
  copyLazyLoadedRelationsToHistory();
  if (contents == null) {
    contents=new ArrayList<String>();
  }
  return contents;
}
 

Example 12

From project zanata, under directory /zanata-model/src/main/java/org/zanata/model/.

Source file: HTextFlowTarget.java

  19 
vote

@Override @Type(type="text") @AccessType("field") @CollectionOfElements(fetch=FetchType.EAGER) @JoinTable(name="HTextFlowTargetContent",[email protected](name="text_flow_target_id")) @IndexColumn(name="pos",nullable=false) @Column(name="content",nullable=false) @Field(name=IndexFieldLabels.CONTENT,index=Index.TOKENIZED,[email protected](impl=StringListBridge.class,params={@Parameter(name="case",value="fold"),@Parameter(name="ngrams",value="multisize")})) @AnalyzerDiscriminator(impl=TextContainerAnalyzerDiscriminator.class) public List<String> getContents(){
  copyLazyLoadedRelationsToHistory();
  if (contents == null) {
    contents=new ArrayList<String>();
  }
  return contents;
}