feature request #7368
cdm 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
.
Associated revisions
fix #7368 implementing isPersisted() in CdmBase
ref #7368 isPersisted() @Transient and doc
ref #7368 add transient also to CdmBase.isPersited
History
#1 Updated by Andreas Kohlbecker almost 3 years ago
- Description updated (diff)
#2 Updated by Andreas Kohlbecker almost 3 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 50
Applied in changeset cdmlib|57f91fb2db32a59d0df5bd72faa837219c1a4ad5.
#3 Updated by Andreas Kohlbecker almost 3 years ago
- Assignee changed from Andreas Kohlbecker to Andreas Müller
please review
#4 Updated by Andreas Müller almost 3 years ago
- Status changed from Resolved to Feedback
- Priority changed from New to Priority14
Generally ok, but I guess we should add @Transient.
#5 Updated by Andreas Müller almost 3 years ago
- Assignee changed from Andreas Müller to Andreas Kohlbecker
#6 Updated by Andreas Müller almost 3 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.
#7 Updated by Andreas Kohlbecker almost 3 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.
#8 Updated by Andreas Kohlbecker almost 3 years ago
- Status changed from Feedback to Resolved
- Assignee changed from Andreas Kohlbecker to Andreas Müller
Done!
#9 Updated by Andreas Müller almost 3 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.
#10 Updated by Andreas Müller almost 3 years ago
- % Done changed from 50 to 100