Get your own customer support community
 

XML Mapping and Annotations Mapping

This isn't a problem as such but the book and the code don't make something explicit.
In chapter 3, the section on mapping with XML shows the Book Entity class without a table annotation but the code that can be downloaded does have such an annotation. The XML mapping also has a table definition but for a different table name than that defined in the annotation.

The important thing to note here is that this does not cause any error but running the test case for the code will show the XML mapping takes place over annotations, which is mentioned in this section of the book although the example given is for a Column annotation against a column xml mapping.

I've posted this just in case anybody else is a bit confused when they look at it.
The good thing is that it does prove that XML takes precendence over annotations, for table names and columns.
 
happy I’m chilled
Inappropriate?
1 person likes this idea

User_default_medium