I've got a @MappedSuperclass which is my base-class for all my entities (@Entity, direct or indirect through multiple sub-classing).
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@XmlAttribute(required = true)
private Long primaryKey;
The Id is generated like shown above.
My problem is that the @Id-counter is the same for each @Entity. In fact thats not a big problem because it would take a while to reach the Long.MAX_VALUE. But reaching that maximum value is a lot easier because there is only one counter for all entities. How can I use a different @Id-counter without having to add the above code to all @Entity-classes?
(If it matters for your answer: I'm using a H2-Database.)