I have a very large (new) project in which we have annotated multiple domain classes with JPA mappings. It's time to implement the query - some organizations have 15-20 named questions. I am thinking that writing these named questions in annotations will mask the source files and hence are considering putting them into XML mapping files.
Is this possible?
Front important, is it fair?
What are the better approaches?
How is this done?
Is this possible?
Yes, that is, but the tendency to focus things is high, not inverted.
More importantly, is it fair?
I my organizations are not unhappy with having a block of comments on top of class files. In fact, I want to inquire where I think they are: beside the institutions i also check the compile time (on unit names, attributes) and java code While writing the question I feel like the code is complete (it is not certain that my IDE will do this with XML mapping). In other words, do not feel the need of i and do not want to exterminate the questions.
What are the better approaches?
I believe the best practice is to use annotations 1
How is this done?
The use of XML mapping files is only for local SQL statements, which is specific a special database (of course, I have left the case for clear written code You can not comment). In other words, use annotation, but keep the code free from vendor-specific stuff as possible.
1 JPA 1.0 specification Co-lead has been included in many trade-offs related to an in-source metadata strategy versus XML Metadata strategy (XML strategy) ( Annotation Strategy) OTN column is apologetic for "annotated or not", I can not find a non dead link for my publication. Perhaps you will be more fortunate and in that case, read it.
Comments
Post a Comment