Skip to content

Instantly share code, notes, and snippets.

@bhdrkn
Created October 6, 2012 13:12
Show Gist options
  • Save bhdrkn/3844912 to your computer and use it in GitHub Desktop.
Save bhdrkn/3844912 to your computer and use it in GitHub Desktop.
rest-db Car.java
package com.bahadirakin.model;
// Generated 06.Eki.2012 16:08:28 by Hibernate Tools 3.4.0.CR1
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
/**
* Car generated by hbm2java
*/
@Entity
@Table(name = "car")
public class Car implements java.io.Serializable {
private Integer id;
private User user;
private String liecencePlate;
private String model;
public Car() {
}
public Car(User user, String liecencePlate) {
this.user = user;
this.liecencePlate = liecencePlate;
}
public Car(User user, String liecencePlate, String model) {
this.user = user;
this.liecencePlate = liecencePlate;
this.model = model;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id", unique = true, nullable = false)
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "userId", nullable = false)
public User getUser() {
return this.user;
}
public void setUser(User user) {
this.user = user;
}
@Column(name = "liecencePlate", nullable = false, length = 50)
public String getLiecencePlate() {
return this.liecencePlate;
}
public void setLiecencePlate(String liecencePlate) {
this.liecencePlate = liecencePlate;
}
@Column(name = "model", length = 50)
public String getModel() {
return this.model;
}
public void setModel(String model) {
this.model = model;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment