package com.bahadirakin.model; // Generated 06.Eki.2012 16:08:28 by Hibernate Tools 3.4.0.CR1 import java.util.HashSet; import java.util.Set; 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.OneToMany; import javax.persistence.Table; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; /** * User generated by hbm2java */ @Entity @Table(name = "user") @XmlRootElement public class User extends AbstractEntity { private static final long serialVersionUID = 1L; private Integer id; private String name; private String surname; private String location; private Set<Car> cars = new HashSet<Car>(0); public User() { } public User(String name, String surname, String location) { this.name = name; this.surname = surname; this.location = location; } public User(String name, String surname, String location, Set<Car> cars) { this.name = name; this.surname = surname; this.location = location; this.cars = cars; } @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; } @Column(name = "name", nullable = false, length = 50) public String getName() { return this.name; } public void setName(String name) { this.name = name; } @Column(name = "surname", nullable = false, length = 50) public String getSurname() { return this.surname; } public void setSurname(String surname) { this.surname = surname; } @Column(name = "location", nullable = false, length = 50) public String getLocation() { return this.location; } public void setLocation(String location) { this.location = location; } @OneToMany(fetch = FetchType.EAGER, mappedBy = "user") public Set<Car> getCars() { return this.cars; } public void setCars(Set<Car> cars) { this.cars = cars; } }