Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] web/email now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as Java by kossmoboleat ( 15 years ago )
package org.hibernate.test.annotations.onetoone.referencedcolumnname;
import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

import org.hibernate.annotations.ForeignKey;

@Entity
public class H implements Serializable{
 private static final long serialVersionUID = 1895413268398105409L;
 
 private String id;
 private String objId;
 private HI hiObject;
 private String value;

 @OneToOne
 @JoinColumn(name = "objId", referencedColumnName = "objIdH", insertable = false, updatable = false, unique = true)
 @ForeignKey(name="none")
 public HI getHiObject() {
  return this.hiObject;
 }

 public void setHiObject(HI hiObject) {
  this.hiObject = hiObject;
 }
 
 @Id
 public String getId() {
  return id;
 }

 public void setId(String id) {
  this.id = id;
 }

 public String getValue() {
  return value;
 }

 public void setValue(String value) {
  this.value = value;
 }

 public void setObjId(String objId) {
  this.objId = objId;
 }

 public String getObjId() {
  return objId;
 }
}

 

Revise this Paste

Your Name: Code Language: