I am trying to figure out how to make comparisons for two different projects that have some entities. Since they only have a limited subset of mappings, my first idea was to split these mappings into a separate jar. I use hibernation annotations to do mappings (so they are in class files, not separate from XML).
Both Project A and Project B depend on this mapping project, which contains only a pair of sleeping mappings. Project A does not have its own mappings, but project B. No matter what I do, this always causes problems, because if I do not set up the persistence block for the mapping project, the mappings will never be accepted. Similarly for project B. If I configure the persistence block in the mapping project, project A works, but running the query in project B just gives me ( Mapping- this is the name of the class):
java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: Mapping is not mapped
I believe this is because project B has its own continuity unit, and obviously the two do not merge. I don’t want this either, I would prefer to only configure it in the A / B project, and not on the bank on which they depend. So, is there a way to tell hibernate to scan and map annotations in the dependency bank and add them to the current continuity block?
source
share