How to configure “hibernate-mapping” to “field”
I want to specify via standard JPA Persistence.createEntityManagerFactory(String,Map<String,String>) to hibernate to use "hibernate-mapping" to "field" rather than "property".
How can I do this, the clean way?
JPA determines which mapping type to use based on where you put your @Id annotation. So if you put your @Id annotation on a field then the mapping will be field-based.
In JPA 2.0 You can also use the @Access annotation. You can apply it to the class to specify the access type for the entire entity and you can apply it to individual fields/methods to override the default for a single field/property.