Synched with Local

This commit is contained in:
egmp777 2014-05-09 18:05:11 -05:00
parent 554df1148d
commit 08aa91739e
2 changed files with 26 additions and 28 deletions

View File

@ -1,7 +1,6 @@
package org.baeldung.persistence.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@ -12,53 +11,53 @@ import javax.persistence.CascadeType;
@Entity
public class Bar implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Column(nullable = false)
private String name;
private int id;
@OneToMany(mappedBy = "bar", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@OrderBy("name ASC")
List<Foo> fooList;
private String name;
public Bar(){
super();
}
public Bar(final String name){
super();
this.name = name;
}
//API
public long getId() {
return id;
}
public void setId(final long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
public List<Foo> getFooList() {
return fooList;
}
public void setFooList(final List<Foo> fooList) {
public void setFooList(List<Foo> fooList) {
this.fooList = fooList;
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
//
@Override

View File

@ -1,7 +1,6 @@
package org.baeldung.persistence.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;