javax.persistence.JoinColumn Java Examples

The following examples show how to use javax.persistence.JoinColumn. 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
Source File: JPAEdmReferentialConstraintRole.java    From cloud-odata-java with Apache License 2.0 6 votes vote down vote up
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
Source File: InterroleInterfaceEntity.java    From jeecg with 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 #3
Source File: ImageOverview.java    From uyuni with 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 #4
Source File: SwedenElectionType.java    From cia with 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 #5
Source File: ImagePackage.java    From uyuni with 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 #6
Source File: ElectricPowerQualitySummaryPersistenceTests.java    From OpenESPI-Common-java with Apache License 2.0 5 votes vote down vote up
@Test
public void usagePoint() {
	TestUtils.assertAnnotationPresent(ElectricPowerQualitySummary.class,
			"usagePoint", ManyToOne.class);
	TestUtils.assertAnnotationPresent(ElectricPowerQualitySummary.class,
			"usagePoint", JoinColumn.class);
}
 
Example #7
Source File: ReadingQualityPersistenceTests.java    From OpenESPI-Common-java with Apache License 2.0 5 votes vote down vote up
@Test
public void readingQualities() {
	TestUtils.assertAnnotationPresent(ReadingQuality.class, "intervalReading",
			ManyToOne.class);
	TestUtils.assertAnnotationPresent(ReadingQuality.class, "intervalReading",
			JoinColumn.class);
}
 
Example #8
Source File: TaskData.java    From scheduling with 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 File: EventOptions.java    From pikatimer with 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", joinColumns=@JoinColumn(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 #10
Source File: KundeDO.java    From projectforge-webapp with 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 #11
Source File: DataElement.java    From cia with 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 #12
Source File: RechnungDO.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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 #13
Source File: User.java    From aws-photosharing-example with 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 #14
Source File: HRPlanningDO.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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 #15
Source File: Topics.java    From cia with 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 #16
Source File: ImageBuildHistory.java    From uyuni with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return the image info
 */
@ManyToOne
@JoinColumn(name = "image_info_id")
public ImageInfo getImageInfo() {
    return imageInfo;
}
 
Example #17
Source File: TemProfile.java    From kfs with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
@ManyToOne
@JoinColumn(name = "traveler_typ_cd")
public TravelerType getTravelerType() {
    return travelerType;
}
 
Example #18
Source File: JavamailMessage.java    From lemon with Apache License 2.0 4 votes vote down vote up
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CONFIG_ID")
public JavamailConfig getJavamailConfig() {
    return this.javamailConfig;
}
 
Example #19
Source File: TSNoticeAuthorityRole.java    From jeecg with Apache License 2.0 4 votes vote down vote up
@ManyToOne
@JoinColumn(name="role_id")
public TSRole getRole() {
	return role;
}
 
Example #20
Source File: Menu.java    From dpCms with Apache License 2.0 4 votes vote down vote up
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumn(name = "ACCOUNT_ID",nullable = false, insertable = false, updatable = false)
public Account getAccount() {
	return account;
}
 
Example #21
Source File: GroupTaskAccessDO.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE})
@JoinColumn(name = "group_id")
public GroupDO getGroup()
{
  return group;
}
 
Example #22
Source File: DynamicForm.java    From OA with GNU General Public License v3.0 4 votes vote down vote up
@OneToOne
@JoinColumn(name = "workflowId")
public WorkFlow getWorkFlow() {
	return workFlow;
}
 
Example #23
Source File: ImportedExpenseBase.java    From kfs with GNU Affero General Public License v3.0 4 votes vote down vote up
/**
 * Gets the creditCardAgency attribute.
 * @return Returns the creditCardAgency.
 */
@ManyToOne
@JoinColumn(name="CREDIT_AGENCY_CD")
public CreditCardAgency getCreditCardAgency() {
    return creditCardAgency;
}
 
Example #24
Source File: InstructorClasses.java    From sample-java-spring-genericdao with Apache License 2.0 4 votes vote down vote up
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "INSTRUCTOR_ID", nullable = false)
public Instructor getInstructors() {
	return this.instructors;
}
 
Example #25
Source File: RolePermission.java    From Spring-MVC-Blueprints with MIT License 4 votes vote down vote up
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "userId", nullable = false)
public Login getLogin() {
	return this.login;
}
 
Example #26
Source File: PerformanceExamine.java    From OA with GNU General Public License v3.0 4 votes vote down vote up
@OneToOne
@JoinColumn(name="personId")
public Person getPersonId() {
	return personId;
}
 
Example #27
Source File: InterroleInterfaceEntity.java    From jeecg with Apache License 2.0 4 votes vote down vote up
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "interrole_id")
public InterroleEntity getInterroleEntity() {
	return this.interroleEntity;
}
 
Example #28
Source File: DiskAcl.java    From lemon with Apache License 2.0 4 votes vote down vote up
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "SHARE_ID")
public DiskShare getDiskShare() {
    return this.diskShare;
}
 
Example #29
Source File: TSLog.java    From jeewx with Apache License 2.0 4 votes vote down vote up
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "userid")
public TSUser getTSUser() {
	return this.TSUser;
}
 
Example #30
Source File: DynamicField.java    From OA with GNU General Public License v3.0 4 votes vote down vote up
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="fieldInput", referencedColumnName="id")
public FiledInput getInput() {
	return input;
}