Java Code Examples for javax.persistence.JoinColumn

The following examples show how to use javax.persistence.JoinColumn. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private void firstBuild() {
  firstBuild = false;
  isConsistent = false;

  extractJoinColumns();

  if (!roleExists) {
    return;
  }

  jpaColumnNames = new ArrayList<String>();

  for (JoinColumn joinColumn : bufferedJoinColumns) {
    if (roleType == RoleType.PRINCIPAL) {
      jpaColumnNames.add(joinColumn.referencedColumnName());
    } else if (roleType == RoleType.DEPENDENT) {
      jpaColumnNames.add(joinColumn.name());
    }
  }

}
 
Example 2
/**
 * Rechnungsempfänger. Dieser Kunde kann vom Kunden, der mit dem Projekt verbunden ist abweichen.
 */
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "kunde_id", nullable = true)
public KundeDO getKunde()
{
  return kunde;
}
 
Example 3
Source Project: cia   Source File: DataElement.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the data.
*
* @return the data
*/
  @OneToMany(targetEntity = WorldBankData.class, cascade = {
      CascadeType.ALL
  })
  @JoinColumn(name = "DATA__DATA_ELEMENT_HJID")
  public List<WorldBankData> getData() {
      return this.data;
  }
 
Example 4
Source Project: jeecg   Source File: InterroleInterfaceEntity.java    License: Apache License 2.0 5 votes vote down vote up
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "interface_id")

@NotFound(action=NotFoundAction.IGNORE)

public TSInterfaceEntity getInterfaceEntity() {
	return this.interfaceEntity;
}
 
Example 5
@Test
public void readingQualities() {
	TestUtils.assertAnnotationPresent(ReadingQuality.class, "intervalReading",
			ManyToOne.class);
	TestUtils.assertAnnotationPresent(ReadingQuality.class, "intervalReading",
			JoinColumn.class);
}
 
Example 6
Source Project: uyuni   Source File: ImagePackage.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return Returns the evr.
 */
@Id
@ManyToOne
@JoinColumn(name = "evr_id")
public PackageEvr getEvr() {
    return evr;
}
 
Example 7
Source Project: uyuni   Source File: ImageOverview.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return the inspect action
 */
@ManyToOne
@JoinColumn(name = "inspect_action_id", referencedColumnName = "id", insertable = false,
        updatable = false)
public Action getInspectAction() {
    return inspectAction;
}
 
Example 8
Source Project: scheduling   Source File: TaskData.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
@Cascade(CascadeType.ALL)
@OneToOne(fetch = FetchType.LAZY)
// disable foreign key, to be able to remove runtime data
@JoinColumn(name = "PRE_SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
public ScriptData getPreScript() {
    return preScript;
}
 
Example 9
Source Project: cia   Source File: SwedenElectionType.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the region.
*
* @return the region
*/
  @ManyToOne(targetEntity = SwedenElectionRegion.class, cascade = {
      CascadeType.ALL
  })
  @JoinColumn(name = "REGION_SWEDEN_ELECTION_TYPE__0")
  public SwedenElectionRegion getRegion() {
      return region;
  }
 
Example 10
Source Project: aws-photosharing-example   Source File: User.java    License: Apache License 2.0 5 votes vote down vote up
@XmlTransient
 @LazyCollection(LazyCollectionOption.EXTRA)
 @ManyToMany(fetch=FetchType.LAZY, cascade=CascadeType.ALL)
 @JoinTable(name = "role_mappings", joinColumns = { 
@JoinColumn(name = "user_id", nullable = false, updatable = false) }, 
inverseJoinColumns = { @JoinColumn(name = "role", 
		nullable = false, updatable = false) })
 public List<Role> getRoles() {return _roles;}
 
Example 11
/**
 * Get the entries for this planned week.
 */
@OneToMany(cascade = { CascadeType.ALL}, fetch = FetchType.EAGER, orphanRemoval = true)
@JoinColumn(name = "planning_fk")
@Cascade(value = org.hibernate.annotations.CascadeType.SAVE_UPDATE)
public List<HRPlanningEntryDO> getEntries()
{
  return this.entries;
}
 
Example 12
Source Project: cia   Source File: Topics.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the topic.
*
* @return the topic
*/
  @OneToMany(targetEntity = Topic.class, cascade = {
      CascadeType.ALL
  })
  @JoinColumn(name = "TOPIC_TOPICS_HJID")
  public List<Topic> getTopic() {
      return this.topic;
  }
 
Example 13
Source Project: projectforge-webapp   Source File: KundeDO.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * This Datev account number is used for the exports of invoices. This account numbers may-be overwritten by the ProjektDO which is assigned to an invoice.
 * @return
 */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "konto_id")
public KontoDO getKonto()
{
  return konto;
}
 
Example 14
@Test
public void usagePoint() {
	TestUtils.assertAnnotationPresent(ElectricPowerQualitySummary.class,
			"usagePoint", ManyToOne.class);
	TestUtils.assertAnnotationPresent(ElectricPowerQualitySummary.class,
			"usagePoint", JoinColumn.class);
}
 
Example 15
Source Project: pikatimer   Source File: EventOptions.java    License: GNU General Public License v3.0 5 votes vote down vote up
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name="attribute", insertable=false,updatable=false)
@Column(name="value")
@CollectionTable(name="event_options_attributes", [email protected](name="event_id"))
//@OrderColumn(name = "index_id")
private Map<String, String> getAttributes() {
    System.out.println("EventOptions::getAttributes()");
    attributes.keySet().forEach(k -> {
    System.out.println("  " + k + " -> " + attributes.get(k));
    });
    return attributes;
}
 
Example 16
Source Project: Spring-MVC-Blueprints   Source File: BookedTrip.java    License: MIT License 4 votes vote down vote up
@JsonManagedReference("booked-data")
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "tripId", nullable = false)
public Trip getTrip() {
	return this.trip;
}
 
Example 17
Source Project: juddi   Source File: TmodelCategoryBag.java    License: Apache License 2.0 4 votes vote down vote up
@OneToOne(optional=false, fetch = FetchType.LAZY)
   @JoinColumn(name = "entity_key")
public Tmodel getTmodel() {
	return tmodel;
}
 
Example 18
Source Project: OA   Source File: OrderProductRecord.java    License: GNU General Public License v3.0 4 votes vote down vote up
@ManyToOne
@JoinColumn(name="productId",referencedColumnName="id")
public Product getProduct() {
	return product;
}
 
Example 19
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "skill_fk")
public SkillDO getSkill()
{
  return skill;
}
 
Example 20
Source Project: we-cmdb   Source File: AdmStateTransition.java    License: Apache License 2.0 4 votes vote down vote up
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "operation", insertable = false, updatable = false)
public AdmBasekeyCode getOperationCode() {
    return operationCode;
}
 
Example 21
Source Project: celerio-angular-quickstart   Source File: Passport.java    License: Apache License 2.0 4 votes vote down vote up
@JoinColumn(name = "HOLDER_ID", nullable = false, unique = true)
@OneToOne
public User getHolder() {
    return holder;
}
 
Example 22
Source Project: jeewx   Source File: TSOperation.java    License: Apache License 2.0 4 votes vote down vote up
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "iconid")
public TSIcon getTSIcon() {
	return TSIcon;
}
 
Example 23
Source Project: lemon   Source File: BpmConfAssign.java    License: Apache License 2.0 4 votes vote down vote up
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "NODE_ID")
public BpmConfNode getBpmConfNode() {
    return this.bpmConfNode;
}
 
Example 24
Source Project: zxl   Source File: AclObjectIdentity.java    License: Apache License 2.0 4 votes vote down vote up
@ManyToOne
@JoinColumn
public AclSid getSid() {
	return sid;
}
 
Example 25
Source Project: Spring-MVC-Blueprints   Source File: BillingAddress.java    License: MIT License 4 votes vote down vote up
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "userId", nullable = false)
public CustomerAccount getCustomerAccount() {
	return this.customerAccount;
}
 
Example 26
Source Project: lemon   Source File: OssBucket.java    License: Apache License 2.0 4 votes vote down vote up
/** @return 外键. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "REGION_ID")
public OssRegion getOssRegion() {
    return this.ossRegion;
}
 
Example 27
Source Project: we-cmdb   Source File: AdmCiTypeAttrGroup.java    License: Apache License 2.0 4 votes vote down vote up
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "id_adm_attr_group")
public AdmAttrGroup getAdmAttrGroup() {
    return this.admAttrGroup;
}
 
Example 28
Source Project: hrms   Source File: Dept.java    License: Apache License 2.0 4 votes vote down vote up
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "parentDeptId")
public Dept getParentDept() {
	return this.parentDept;
}
 
Example 29
Source Project: jeecg   Source File: InterroleUserEntity.java    License: Apache License 2.0 4 votes vote down vote up
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "interrole_id")
public InterroleEntity getInterroleEntity() {
	return interroleEntity;
}
 
Example 30
Source Project: lemon   Source File: CmsCatalog.java    License: Apache License 2.0 4 votes vote down vote up
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_ID")
public CmsCatalog getCmsCatalog() {
    return this.cmsCatalog;
}