0

I got a problem where I'm not able to find a solution. We got a shared library with all entities which are setup to use with JavaEE 6 entities (Websphere). So mapping is based on the JavaEE 6 jpa annotations.

unfortunately this doesn't work out of the box with Spring Boot. Because not all annotations combinations are supported.

e.g.: Caused by: org.hibernate.AnnotationException: @Column(s) not allowed on a @OneToOne property:

Used Database is db2. The connection works fine. Only the share entity model does not work out the box.

I'm looking now to use a spring boot application that uses openjpa with a db2 database and a persistence.xml with an external jar file. Someone got any experience with this?

Michel
  • 9,220
  • 13
  • 44
  • 59
  • why didnt you use `@JoinColumn` on the `@OneToOne`? and fix specifics? So it then follows the JPA spec – Neil Stockton May 29 '17 at 14:56
  • We are not able to change the external jar-file – Michel May 29 '17 at 15:09
  • So the "external jar-file" has got non-compliant code in it? good luck with that. You should define WHAT software gives that error by the way. – Neil Stockton May 29 '17 at 15:13
  • The external jar-file works perfect with other Java EE 6 websphere applications. Spring Boot gives the error stated above. But that is just an example. Entity Annotation Mapping for hibernate and openJPA is unfortunately not the same (it looks like) – Michel May 29 '17 at 15:22
  • So the problem is with Spring-Boot doing its own error checking ? whereas the real JPA provider just ignores crap metadata. So raise a bug on Spring-Boot. Maybe they have some config to turn off their own checks – Neil Stockton May 29 '17 at 15:25
  • @NeilStockton Sorry that is not what I meant. The error is throw by Hibernate. It is a `org.hibernate.AnnotationException`. And the JavaEE 6 application is using OpenJPA – Michel May 29 '17 at 15:30
  • If you are looking to use OpenJPA with SpringBoot, why is Hibernate throwing an exception?! Hibernate should not be even mentioned anywhere – Neil Stockton May 29 '17 at 18:14
  • If Hibernate is throwing exceptions, you are using Hibernate, not OpenJPA – Jens Schauder May 30 '17 at 04:45
  • I voted to closed this question and opened a new one. How to get openjpa working with Spring boot and an external jar-file with the persistence-unit: https://stackoverflow.com/questions/44255023/reference-a-jar-file-in-de-persistence-xml-within-a-spring-boot-project – Michel May 30 '17 at 09:21

0 Answers0