Earlier I shared the Java/JDK issues that I faced while writing an annotation processor. Today I am going to share my experience of using Maven. The issues have hardly anything to do with the annotation processor itself.
Recently I was writing an annotation processor that would generate a persistence.xml file when I compile my JPA entity classes. If you are a Java Persistence API user, then you may actually be interested in that annotation processor. OK, enough of shameless self promotion.
I am glad to say that in most cases, I do not write a persistence.xml file any more. No, I am not using any IDE to generate it for me, nor has the spec relaxed any requirement. We will discuss some other time why persistence.xml is a necessary evil. Then what has changed? Well, my compiler creates it for me - yes, I said javac creates it for me.
What is persistence context propagation?
A persistence context(PC) is a set of managed entity instances in which for any persistent entity identity there is a unique entity instance (this definition is taken from Java Persistence API spec, section 5.1).
Earlier we had shown how to plug in Hibernate in GlassFish. Now it's time for Kodo, which is another high performance & popular O/R mapping solution.
Can I use Hibernate in GlassFish? is a question I have been asked several times in recent past? Well, the answer is Yes & No(as of now), depending on what you are trying to use it as. By the way I must clarify, it's a NO only temporarily.