Ok so here's my situation. I have two classes which use JPA annotations to describe schema.
Class
A is a simple class that looks something like this...
Code:
@Embeddable
public class A
{
private String name;
private Object value;
}
and I have class
B which contains two members of type
A like so...
Code:
@Entity
@Table(name = "table_b")
public class B
{
private A member1;
private A member2;
}
Now when I compile and run my code I noticed two things. First, I don't see any fields in the generated database schema for either of
member1 or
member2. If I have only one member of type
A I normally get two columns in my database; one for
name and one for
value. Instead i'm just getting runtime errors that hibernate can't figure out what to do. What is wrong with my code? How can I get two members of the same type to be embeddable or is this simply a bug of hibernate?