-
1. Re: EntityNotFoundException after AuditReaderFactory.get(...)
adamw Oct 31, 2012 10:13 AM (in response to jorj87)Not sure if it's the cause of your problem, but why do you have targetAuditMode = RelationTargetAuditMode.NOT_AUDITED? It should only be used on fields that are relations and the other side is not audited. So here you just need @Audited.
Otherwise ... more code would be needed to see what's wrong.
Adam
-
2. Re: EntityNotFoundException after AuditReaderFactory.get(...)
jorj87 Nov 1, 2012 5:16 AM (in response to adamw)I tried to use @Audited for class TariffEntry, and @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) for him fields, wich hasnot auditing... with same result
In my case I found error (may be not main): in the depth of the stack (in AuditReaderFactory.get(...) ) invoke TariffEntry.hashCode() {.... getTariff().hashCode()...}, but in this place Tariff is not initialized yet, and it throw Ex. I changed this method.
PS: EntityNotFoundException is very strange in this case
-
3. Re: EntityNotFoundException after AuditReaderFactory.get(...)
adamw Nov 1, 2012 5:28 AM (in response to jorj87)For not audited fields you should use @NotAudited. targetAuditMode is only useable if the target entity in a relation isn't audited.
I agree the exception is strange... but I don't have any other ideas right now.
Adam
-
4. Re: EntityNotFoundException after AuditReaderFactory.get(...)
jorj87 Nov 1, 2012 6:42 AM (in response to adamw)... targetAuditMode is only useable if the target entity in a relation isn't audited...
Do you mean not to be audited on a chain? I had it in view
-
5. Re: EntityNotFoundException after AuditReaderFactory.get(...)
adamw Nov 1, 2012 6:59 AM (in response to jorj87)I don't understand your question
Adam
-
6. Re: EntityNotFoundException after AuditReaderFactory.get(...)
jorj87 Nov 1, 2012 7:18 AM (in response to adamw)Sorry for my English.
If I dont want to audit changes for field - I use @NotAudited for field
If I want to audit a change ID only(for example) some entity (her class is @NotAudited)) - I use @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
it's right or wrong?
-
7. Re: EntityNotFoundException after AuditReaderFactory.get(...)
adamw Nov 1, 2012 9:02 AM (in response to jorj87)1 of 1 people found this helpfulCorrect
Adam