Skip to content

Instantly share code, notes, and snippets.

@gabanox
Created October 16, 2014 15:25
Show Gist options
  • Save gabanox/5824836d3cd3a2c8beae to your computer and use it in GitHub Desktop.
Save gabanox/5824836d3cd3a2c8beae to your computer and use it in GitHub Desktop.
/**
* Created on Oct 12, 2011
*/
package com.company.app.domain;
import static javax.persistence.GenerationType.IDENTITY;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Version;
@Entity
@Table(name = "contact_tel_detail")
public class ContactTelDetail implements Serializable {
private Long id;
private int version;
private Contact contact;
private String telType;
private String telNumber;
public ContactTelDetail() {
}
public ContactTelDetail(String telType, String telNumber) {
this.telType = telType;
this.telNumber = telNumber;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "ID")
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
@Version
@Column(name = "VERSION")
public int getVersion() {
return this.version;
}
public void setVersion(int version) {
this.version = version;
}
@ManyToOne
@JoinColumn(name = "CONTACT_ID")
public Contact getContact() {
return this.contact;
}
public void setContact(Contact contact) {
this.contact = contact;
}
@Column(name = "TEL_TYPE")
public String getTelType() {
return this.telType;
}
public void setTelType(String telType) {
this.telType = telType;
}
@Column(name = "TEL_NUMBER")
public String getTelNumber() {
return this.telNumber;
}
public void setTelNumber(String telNumber) {
this.telNumber = telNumber;
}
public String toString() {
return "Contact Tel Detail - Id: " + id + ", Contact id: " + getContact().getId()
+ ", Type: " + telType + ", Number: " + telNumber;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment