
test.googlecode.genericdao.model.Home Maven / Gradle / Ivy
/* Copyright 2009 The Revere Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.googlecode.genericdao.model;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
@Entity
@Table(name = "home")
public class Home {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String type;
@OneToOne
@JoinColumn(name = "address_id")
private Address address;
@OneToMany(mappedBy = "home", fetch = FetchType.EAGER)
private List residents;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Address getAddress() {
return address;
}
public void setAddress(Address address) {
this.address = address;
}
public List getResidents() {
return residents;
}
public void setResidents(List residents) {
this.residents = residents;
}
public String toString() {
return "Home::id:" + id + ",type:" + type + ",address:" + address;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy