Skip to content

Instantly share code, notes, and snippets.

@ctataryn
Created January 24, 2012 21:01
Show Gist options
  • Save ctataryn/1672625 to your computer and use it in GitHub Desktop.
Save ctataryn/1672625 to your computer and use it in GitHub Desktop.
JPA Interface problem...
@Entity(name = "Player")
public class PlayerImpl implements Player {
@Id
@Column(name = "PlayerId")
private Integer id = -1;
@Embedded
private PersonName name; //to get this to work, I have to re-type this as PersonNameImpl and cast in the setter
public PersonName getName() {
return name;
}
public void setName(PersonName name) {
this.name = name;
}
.
.
.
}
@Embeddable
public class PersonNameImpl implements PersonName {
@Column(name="FirstName")
private String firstName;
@Column(name="LastName")
private String lastName;
.
.
.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment