Code:
First:
I would like to map a collection (private Map<String, String> whatever) which does not correspond to any whatever class, what is the best way to do this? Im using annotations and would appreciate a code example.
What do you mean by this (what is the collection for)?
If it's not for persisting any data you can just use the @Transient annotation
Code:
Second:
I have a BaseEntity class in which I would like to have "Date createdDate" and "Date lastUpdated" what is the best way to do this. I have tried using a listener but could only get it to work on creation date but I would if possible like to use a simpler solution. Again a code example using annotations would be appreciated.
The listener seems like the best solution.
However in the past I have implemented an interface on all of my entities. And used a manager layer that would always pass my entities to methods in a superclass that all my managers extended. This only works when you are starting from scratch and your persisting one class at a time.
I would be interested in any other solutions to this problem also.