Hi All

I have a class that extends a entity with a standard ID in. In the
extended class I want to add another id field say userID. What would be
the best way of doing this.

My classes are structured as follows:

@Entity
public class Person implements Serializable {
    
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    //other fields and methods omitted

}

@Entity
public class Userbase extends Person {
    
    private Long userID; //other identity field

    // other values omitted
}

What would be the best way of achieving this. Would an Identity class be
sensible. If so are the any examples that use this method.

Thanks

David

Reply via email to