[hibernate-dev] Typing Help with JPA 2.1 impl

Steve Ebersole steve at hibernate.org
Thu Jul 19 13:38:41 EDT 2012


Actually it looks like some other changes now require JDK 1.7 to be 
used.  Specifically some changes in either the hibernate-mapping.xsd or 
in the JAXB/XJC piece that parses it.  It is now trying to add an 
attribute to the generated classes that is only valid in JDK 1.7 
(javax.xml.bind.annotation.XmlElementRef#required specifically)

On Thu 19 Jul 2012 08:36:29 AM CDT, Steve Ebersole wrote:
> Wanted to make sure it was clear that as I move this out to metamodel,
> building metamodel will also require JDK 1.7 to build.
>
> Also, this does not mean we will "move to" JDK 1.7 as a base for
> Hibernate 5 *necessarily*.  I am open to that discussion, too, but
> really it just means that right now that is what is needed for
> building these code bases.  See the rest of this previous discussion
> for the proposed alternatives...
>
>
> On Thu 19 Jul 2012 08:20:52 AM CDT, Steve Ebersole wrote:
>> Just an FYI that this code has now bee integrated into master (4.1 has
>> been branched off).  That means that as of now, to build master you
>> will have to use JDK 1.7...
>>
>>
>> On 06/14/2012 10:24 AM, Steve Ebersole wrote:
>>> Interesting, once I got it compiled (using Java 7) I could then run the
>>> tests fine using Java 6 or 7.
>>>
>>>
>>> On Thu 14 Jun 2012 09:50:10 AM CDT, Hardy Ferentschik wrote:
>>>> Using:
>>>>
>>>> JVM: 1.6.0_31 (Apple Inc. 20.6-b01-415)
>>>> OS: Mac OS X 10.7.4 x86_64
>>>>
>>>> I get:
>>>>
>>>> ant:javac]
>>>> /Users/hardy/tmp/core/hibernate-jpa2.1-working/hibernate-entitymanager/src/main/java/org/hibernate/ejb/criteria/CollectionJoinImplementor.java:35:
>>>>
>>>>
>>>> types org.hibernate.ejb.criteria.JoinImplementor<Z,X>  and
>>>> org.hibernate.ejb.criteria.JoinImplementor<Z,X>  are incompatible;
>>>> both define on(javax.persistence.criteria.Predicate[]), but with
>>>> unrelated return types
>>>> [ant:javac] public interface CollectionJoinImplementor<Z,X>  extends
>>>> JoinImplementor<Z,X>, CollectionJoin<Z,X>  {
>>>> [ant:javac]        ^
>>>> [ant:javac]
>>>> /Users/hardy/tmp/core/hibernate-jpa2.1-working/hibernate-entitymanager/src/main/java/org/hibernate/ejb/criteria/JoinImplementor.java:37:
>>>>
>>>>
>>>> types javax.persistence.criteria.Fetch<Z,X>  and
>>>> javax.persistence.criteria.Join<Z,X>  are incompatible; both define
>>>> on(javax.persistence.criteria.Predicate[]), but with unrelated return
>>>> types
>>>> [ant:javac] public interface JoinImplementor<Z,X>  extends Join<Z,X>,
>>>> Fetch<Z,X>, FromImplementor<Z,X>  {
>>>> [ant:javac]        ^
>>>> [ant:javac]
>>>> /Users/hardy/tmp/core/hibernate-jpa2.1-working/hibernate-entitymanager/src/main/java/org/hibernate/ejb/criteria/ListJoinImplementor.java:35:
>>>>
>>>>
>>>> types org.hibernate.ejb.criteria.JoinImplementor<Z,X>  and
>>>> org.hibernate.ejb.criteria.JoinImplementor<Z,X>  are incompatible;
>>>> both define on(javax.persistence.criteria.Predicate[]), but with
>>>> unrelated return types
>>>> [ant:javac] public interface ListJoinImplementor<Z,X>  extends
>>>> JoinImplementor<Z,X>, ListJoin<Z,X>  {
>>>> [ant:javac]        ^
>>>> [ant:javac]
>>>> /Users/hardy/tmp/core/hibernate-jpa2.1-working/hibernate-entitymanager/src/main/java/org/hibernate/ejb/criteria/MapJoinImplementor.java:35:
>>>>
>>>>
>>>> types org.hibernate.ejb.criteria.JoinImplementor<Z,V>  and
>>>> org.hibernate.ejb.criteria.JoinImplementor<Z,V>  are incompatible;
>>>> both define on(javax.persistence.criteria.Predicate[]), but with
>>>> unrelated return types
>>>> [ant:javac] public interface MapJoinImplementor<Z,K,V>  extends
>>>> JoinImplementor<Z,V>, MapJoin<Z,K,V>  {
>>>> [ant:javac]        ^
>>>> [ant:javac]
>>>> /Users/hardy/tmp/core/hibernate-jpa2.1-working/hibernate-entitymanager/src/main/java/org/hibernate/ejb/criteria/SetJoinImplementor.java:35:
>>>>
>>>>
>>>> types org.hibernate.ejb.criteria.JoinImplementor<Z,X>  and
>>>> org.hibernate.ejb.criteria.JoinImplementor<Z,X>  are incompatible;
>>>> both define on(javax.persistence.criteria.Predicate[]), but with
>>>> unrelated return types
>>>> [ant:javac] public interface SetJoinImplementor<Z,X>  extends
>>>> JoinImplementor<Z,X>, SetJoin<Z,X>  {
>>>> [ant:javac]        ^
>>>> [ant:javac] Note: Some input files use or override a deprecated API.
>>>> [ant:javac] Note: Recompile with -Xlint:deprecation for details.
>>>> [ant:javac] Note: Some input files use unchecked or unsafe operations.
>>>> [ant:javac] Note: Recompile with -Xlint:unchecked for details.
>>>> [ant:javac] 5 errors
>>>>
>>>> Switching to JDK 7:
>>>>
>>>> JVM: 1.7.0-ea (Oracle Corporation 21.0-b17)
>>>> OS: Mac OS X 10.7.4 x86_64
>>>>
>>>> Compile works, but tests seem to hang after:
>>>>
>>>> Building>  :hibernate-entitymanager:test>  282 tests completed
>>>>
>>>>
>>>> --Hardy
>>>>
>>>>
>>>>
>>>> On Jun 14, 2012, at 4:15 PM, Steve Ebersole wrote:
>>>>
>>>>> So I tried with JDK 1.7 and it worked fine.  I am hoping we can get
>>>>> people to try this on different architecture/jdk combos so we can see
>>>>> where the issue boundaries are.
>>>>>
>>>>> I am running on Linux and using the Oracle JDKs:
>>>>> java version "1.6.0_30"
>>>>> java version "1.7.0_03"
>>>>>
>>>>> This does in fact seem to be an issue in the Oracle JDK code.  The
>>>>> bug is 6294779, but it does not seem to be available in the bug
>>>>> database anymore.  According to any reports I could find it was fixed
>>>>> in beta 31 of Java 7 JDK.  But apparently no fix was ever ported to
>>>>> Java 6 JDK.
>>>>>
>>>>> This obviously leads to some interesting question about handling Java
>>>>> versions in Hibernate builds and how to best handle this situation.
>>>>> I'd like to define these boundaries first and then have that
>>>>> discussion.  I have attached my working HEAD with the changes in
>>>>> question (I hope, first time using git archive command).  Can others
>>>>> using alternative JDKs and other OS architectures try compiling this
>>>>> with their Java 6 JDKs?
>>>>>
>>>>> Thanks
>>>>
>>>
>>> --
>>> steve at hibernate.org
>>> http://hibernate.org
>>
>
> --
> steve at hibernate.org
> http://hibernate.org

--
steve at hibernate.org
http://hibernate.org


More information about the hibernate-dev mailing list