I have scala trait as follows
trait Id {
@javax.persistence.Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@BeanProperty
var id: Long = _
}
Now I have an entity (Person) that I want to extend the Id trait but change the id column name to personid.
How can I achieve this?
Person Snippet Below:
@NamedQuery(name=”findAll”,query=”select p from Person p”)
class Person extends Id {
@BeanProperty
@Column(name=”personid”)
def personid = id
}