Id Methods
Entities generally have an Id class created for them by the artifact generator. This provides clarity in the application code as to what kind of Id is being held or passed. Likewise, there are useful methods on these Id classes. Id instances are immutable.
getEntity()
- Get the business entity that this Id refers to or null if no such entity instance exists.getFoo()
- In the case where the Id contains a persistent entityfoo
, return that entity.getBarId()
- Get the contained Id referring to the entitybar
.newDTO()
- Create a new DTO instance with the Id property already set to this Id's value.