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

View File

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