javax.persistence.ManyToOne Java Examples

The following examples show how to use javax.persistence.ManyToOne. 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: 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 #2
Source File: RechnungsPositionDO.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
@Override
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "rechnung_fk", nullable = false)
public RechnungDO getRechnung()
{
  return rechnung;
}
 
Example #3
Source File: ReflectionConverter.java    From onedev with MIT License 5 votes vote down vote up
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected Object unmarshallField(UnmarshallingContext context, Object result, Class type, Field field) {
	if (field.getAnnotation(ManyToOne.class) != null) {
		Long entityId = (Long) context.convertAnother(context.currentObject(), Long.class);
		return AppLoader.getInstance(Dao.class).load((Class<? extends AbstractEntity>) field.getType(), entityId);
	} else {
		return super.unmarshallField(context, result, type, field);
	}
}
 
Example #4
Source File: DocumentStatusContainer.java    From cia with Apache License 2.0 5 votes vote down vote up
/**
* Gets the document detail container.
*
* @return the document detail container
*/
  @ManyToOne(targetEntity = DocumentDetailContainer.class, cascade = {
      CascadeType.ALL
  })
  @JoinColumn(name = "DOCUMENT_DETAIL_CONTAINER_DO_0")
  public DocumentDetailContainer getDocumentDetailContainer() {
      return documentDetailContainer;
  }
 
Example #5
Source File: ImageOverview.java    From uyuni with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return the build action
 */
@ManyToOne
@JoinColumn(name = "build_action_id", referencedColumnName = "id", insertable = false,
        updatable = false)
public Action getBuildAction() {
    return buildAction;
}
 
Example #6
Source File: ConvertionUtils.java    From restcommander with Apache License 2.0 5 votes vote down vote up
public static String valueOf(Object object, java.lang.reflect.Field field) throws Exception {
    if (field.getType().equals(String.class)) {
        return (String ) field.get(object);
    }
    if (field.getType().equals(Blob.class) && field.get(object) != null) {
        return FileExtractor.getText((Blob) field.get(object));
    }

    Object o = field.get(object);
    if (field.isAnnotationPresent(ManyToOne.class) && o instanceof JPABase) {
        return "" + getIdValueFor((JPABase ) o);
    }

    return "" + field.get(object);
}
 
Example #7
Source File: HibernateAnnotationIntrospector.java    From onedev with MIT License 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public Object findSerializer(Annotated am) {
	if (am.hasAnnotation(ManyToOne.class)) {
		return new ManyToOneSerializer((Class<AbstractEntity>) am.getRawType());
	} else {
		return super.findDeserializer(am);
	}
}
 
Example #8
Source File: AddressDO.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Not used as object due to performance reasons.
 * @return
 */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "task_id", nullable = false)
public TaskDO getTask()
{
  return task;
}
 
Example #9
Source File: Reference.java    From livingdoc-core with GNU General Public License v3.0 5 votes vote down vote up
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinColumn(name = "SPECIFICATION_ID")
public Specification getSpecification() {
    return specification;
}
 
Example #10
Source File: TaskDO.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
/** -&gt; Gantt */
@Deprecated
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE}, targetEntity = TaskDO.class)
@JoinColumn(name = "gantt_predecessor_fk")
public TaskDO getGanttPredecessor()
{
  return ganttPredecessor;
}
 
Example #11
Source File: PersonElement.java    From cia with Apache License 2.0 5 votes vote down vote up
/**
* Gets the person detail element.
*
* @return the person detail element
*/
  @ManyToOne(targetEntity = PersonDetailElement.class, cascade = {
      CascadeType.ALL
  })
  @JoinColumn(name = "PERSON_DETAIL_ELEMENT_PERSON_0")
  public PersonDetailElement getPersonDetailElement() {
      return personDetailElement;
  }
 
Example #12
Source File: ImageInfo.java    From uyuni with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return the org
 */
@ManyToOne
public Org getOrg() {
    return org;
}
 
Example #13
Source File: ImageInfo.java    From uyuni with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return the checksum
 */
@ManyToOne
@JoinColumn(name = "checksum_id")
public Checksum getChecksum() {
    return checksum;
}
 
Example #14
Source File: PartyStructRule.java    From lemon with Apache License 2.0 4 votes vote down vote up
/** @return 外键,上级类型. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_TYPE_ID")
public PartyType getParentType() {
    return this.parentType;
}
 
Example #15
Source File: KostZuweisungDO.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "eingangsrechnungs_pos_fk", nullable = true)
public EingangsrechnungsPositionDO getEingangsrechnungsPosition()
{
  return eingangsrechnungsPosition;
}
 
Example #16
Source File: ImportItem.java    From website with GNU Affero General Public License v3.0 4 votes vote down vote up
@ManyToOne(cascade=CascadeType.DETACH, fetch=FetchType.LAZY)
public Product getProduct() {
    return product;
}
 
Example #17
Source File: PlmComponent.java    From lemon with Apache License 2.0 4 votes vote down vote up
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PROJECT_ID")
public PlmProject getPlmProject() {
    return this.plmProject;
}
 
Example #18
Source File: EmergencyContact.java    From kfs with GNU Affero General Public License v3.0 4 votes vote down vote up
@ManyToOne
@JoinColumn(name="cont_rel_typ_cd")
public ContactRelationType getContactRelationType() {
    return contactRelationType;
}
 
Example #19
Source File: PlmRequirement.java    From lemon with Apache License 2.0 4 votes vote down vote up
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "VERSION_ID")
public PlmVersion getPlmVersion() {
    return this.plmVersion;
}
 
Example #20
Source File: AclObjectIdentity.java    From zxl with Apache License 2.0 4 votes vote down vote up
@ManyToOne
@JoinColumn
public AclSid getSid() {
	return sid;
}
 
Example #21
Source File: UserGroup.java    From wetech-cms with MIT License 4 votes vote down vote up
@ManyToOne
@JoinColumn(name="u_id")
public User getUser() {
	return user;
}
 
Example #22
Source File: MeetingAttendee.java    From lemon with Apache License 2.0 4 votes vote down vote up
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "INFO_ID")
public MeetingInfo getMeetingInfo() {
    return this.meetingInfo;
}
 
Example #23
Source File: Tblstudentgrades.java    From Spring-MVC-Blueprints with MIT License 4 votes vote down vote up
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "courseCode", nullable = false)
public Tblcourses getTblcourses() {
	return this.tblcourses;
}
 
Example #24
Source File: Operator.java    From juddi with Apache License 2.0 4 votes vote down vote up
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "entity_key_ed", nullable = true)
public ReplicationConfiguration getParent() {
        return this.parent;
}
 
Example #25
Source File: MeetingInfo.java    From lemon with Apache License 2.0 4 votes vote down vote up
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "MEETING_ROOM_ID")
public MeetingRoom getMeetingRoom() {
    return this.meetingRoom;
}
 
Example #26
Source File: SkuInfo.java    From lemon with Apache License 2.0 4 votes vote down vote up
/** @return 外键,分类. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CATEGORY_ID")
public SkuCategory getSkuCategory() {
    return this.skuCategory;
}
 
Example #27
Source File: Catalog.java    From Spring-MVC-Blueprints with MIT License 4 votes vote down vote up
@JsonBackReference("uom-type")
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "uomId", nullable = false)
public Uom getUom() {
	return this.uom;
}
 
Example #28
Source File: CmsComment.java    From lemon with Apache License 2.0 4 votes vote down vote up
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_ID")
public CmsComment getCmsComment() {
    return this.cmsComment;
}
 
Example #29
Source File: InterroleUserEntity.java    From jeecg with Apache License 2.0 4 votes vote down vote up
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "user_id")
public TSUser getTSUser() {
	return this.TSUser;
}
 
Example #30
Source File: Poster.java    From website with GNU Affero General Public License v3.0 4 votes vote down vote up
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "THEME_ID", insertable = true, updatable = false, nullable = false)
public PaperightTheme getTheme() {
	return theme;
}