I’m using Jpa with GAE. I have an Entity with collection of sub Entity as listed below.
In Entity A I’m using long as Id, In B I’m using Key as Id.
Now evreything works fine except that I need to import 8MB JAR file appengine-api.jar to my android app just for the Key class.
I tried extracting the jar and take only Key.class but it was messy because I had to add more classes that Key.class is using.
Is there another type of key that I can use?
@Entity
public class A implements Serializable
{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private int a;
@OneToMany
@Basic
private List<B> bList;
.
.
}
@Entity
public class B implements Serializable
{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key key;
int b;
.
.
}
Unfortunately not, Key is the only class of this kind that is available. It has no superclass or meaningful interface you may use instead.