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.
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.
1
person likes this idea
I like this idea!
Tell me when this idea gets some attention.
The more people who like this idea, the more it gets noticed.
The more people who like this idea, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Thanks for this clarification. I'll try to clarify it even better if one day I write a second edition ;o)
Loading Profile...



EMPLOYEE