java - Best way to add annotations to inherited methods -


I have a number of composite superclasses, of which my concrete class is deprived of various methods. Some of these methods require a JPA or JACAB annotation in the concrete section. Currently, I do this through:

  @milokal annotation @override method inherited to public method (yard) {super.inheritedMethodHere (yadda yadda); }  

Is there any way to do this without overriding this method? It seems that to override a method to supply local comments to such a waste. Unfortunately, better than what you're doing now, with the annotation of JPA you have JPA Annotations. You will need to override the method, considering the specific information that will be required.

With JPA annotations, you actually have two options - you can annotate the methods, or you can annotate the properties on our project we have standardized on annotating properties instead of the methods. , But this will not help you because the property is potentially part of the concrete square. (If they are shared somehow in Superclass, then you have to actually give details of the methods, and override them.)

It is difficult to recommend without looking at your schema, But if your unit squares are so similar they share many properties in the super-class - can they be stored in the same table, possibly with a different type of column?

Or alternatively if they are not not almost identical, can you reproduce the common properties in each concrete square? By trying to capture the common qualities in the Super Class, you can do more to work yourself rather than protect yourself. Since you have to annotate them individually in concrete classes, only declare them in concrete sections. If you need general methods of interacting with these methods, then there may be an answer to a different utility class to catch those tasks.

On our project, we sometimes use a common super class for institutions, but this is data about some meta unit - nothing that will impact on strong logic. Therefore, the intangible class does not require JPA annotation (nor will they mean the same).


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -