feature request #7368
closedcdm entities report persistence state
100%
Description
all cdm entities should have method to report if the object is persisted or not.
public boolean isPersisted(){
return id != 0;
}
By this cluttering application code with if(myCdmEntitiy.getId() != 0) {...}
can be avoided and replaced with a more meaningful method call. 'if(myCdmEntitiy.isPersisted()) {...}'
This should be implemented into CdmBase
.
Updated by Andreas Kohlbecker over 6 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 50
Applied in changeset cdmlib|57f91fb2db32a59d0df5bd72faa837219c1a4ad5.
Updated by Andreas Kohlbecker over 6 years ago
- Assignee changed from Andreas Kohlbecker to Andreas Müller
please review
Updated by Andreas Müller over 6 years ago
- Status changed from Resolved to Feedback
- Priority changed from New to Priority14
Generally ok, but I guess we should add @Transient.
Updated by Andreas Müller over 6 years ago
- Assignee changed from Andreas Müller to Andreas Kohlbecker
Updated by Andreas Müller over 6 years ago
Maybe we should also add a comment that it does not necessarily mean that there is a database record already but maybe the object was only saved to a persistence session. But maybe this is clear anyway.
Updated by Andreas Kohlbecker over 6 years ago
Andreas Müller wrote:
I guess we should add @Transient.
Agreed!
Maybe we should also add a comment that it does not necessarily mean that there is a database record already but maybe the object was only saved to a persistence session. But maybe this is clear anyway.
I think this is clear anyway but adding your sentence does not hurt and may avoid irritation.
Updated by Andreas Kohlbecker over 6 years ago
- Status changed from Feedback to Resolved
- Assignee changed from Andreas Kohlbecker to Andreas Müller
Done!
Updated by Andreas Müller over 6 years ago
- Status changed from Resolved to Closed
- Assignee changed from Andreas Müller to Andreas Kohlbecker
I don't think @Transient is enough on the interface therefore I also added it to CdmBase.