Comments (7)
Understanding your problem will be easier with the code. Please point us to your branch, or send a PR, so we can have a look?
from hibernate-test-case-templates.
Sure, it was this fork:
https://github.com/geoffreywiseman/hibernate-test-case-templates
from hibernate-test-case-templates.
Your problem was that you defined the entities in your main code, but the persistence.xml
in your tests.
If I remember correctly, Hibernate ORM will only look for entities in the same JAR as the persistence.xml when performing classpath scanning.
So moving the persistence.xml to the main code fixes the problem: geoffreywiseman#1
Alternatively, you can move the entities to the test code, which is generally what we do for test cases.
I will close this issue for now, feel free to reopen if my answer didn't help.
from hibernate-test-case-templates.
Ok, I guess that makes some sense. Normally I'd expect tests to include and use the main classpath as well as their own classpath, but I don't know that much about how the Hibernate JPA scanning is written. It probably makes sense to compartmentalize somewhat in case you have multiple JPA-enabled JARs in a single classpath. Anyway: might not be a terrible idea to suggest where you reference automation detection that the model will be automatically detected if it's placed in the src/test
package hierarchy, since that's where persistence.xml
is found.
But thanks, I'll be better able to make a test case next time. ;)
from hibernate-test-case-templates.
what if im using application.properties file how do l solve this error
Panache.getEntityManager().merge(products); is not picking my entity
from hibernate-test-case-templates.
@DonaldMaparura You seem to be using Quarkus. You'll have better answers if you ask the Quarkus community there: https://quarkus.io/community/ . When you ask them, provide the full stack trace, otherwise they are unlikely to understand what is going on.
from hibernate-test-case-templates.
from hibernate-test-case-templates.
Related Issues (8)
- JDBC context is initialized while writing schema only with SchemaCreator HOT 1
- No Persistence provider for EntityManager named templatePU HOT 2
- Add templates that works with the JPA EntityManager too HOT 3
- Add more instructions on how to use the templates HOT 1
- Hi all i got error when using hibernate 5.4.2.Final HOT 1
- Version.java throws ArrayIndexOutOfBoundsException HOT 1
- The hibernate-orm-5 module does not build with Hibernate 5.5.x or 5.6.x HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hibernate-test-case-templates.