Comments (5)
I didn't know, that an intermediate @MappedSuperclass
is even possible, I usually use those classes only as base classes for entities.
But anyway, I think it is more likely that the problem is line 438 where the &&
is applied first, while it should be the ||
:
if (this.inheritanceType == null && this.entityClass.isAnnotationPresent(DiscriminatorColumn.class)
|| this.entityClass.isAnnotationPresent(DiscriminatorValue.class)) {
this.inheritanceType = InheritanceType.SINGLE_TABLE;
}
I guess you are defining a @DiscriminatorValue
and that will reset the already inherited inheritanceType
from JOINED
back to SINGLE_TABLE
.
Can you check what happens if you drop the @DiscriminatorValue
?
from org.fastnate.
May be you right, and the problem is in other line. I didn't test it hard.
But I don't have @DiscriminatorValue annotation in my structure. Your generator takes this value from entity class name.
from org.fastnate.
I've created a test case with your example and it is working correctly.
I fixed the problem with the @DiscriminatorValue
for 1.5.0 but as you said, this is not your problem.
I fixed another problem, if one has a deeper hierarchy (an entity subclass of an entity subclass of an entity class) and if there are references between those entities. But this doesn't apply to your example, too
In this "if" condition body I don't see the row like "this.inheritanceType = parentDescription.inheritanceType;", so "inheritanceType" value of my target class (1) keeps its default value, equals to "SINGLE_TABLE".
I see that just before in line 618:
if (this.inheritanceType == null) {
this.inheritanceType = parentDescription.inheritanceType;
...
}
And that should be enough, because this.inheritanceType != null
would only happen, if you have added @Inheritance(strategy = InheritanceType.JOINED)
to the subclass (class (1)
). Which would be an error, as that annotation is only allowed for the root class.
Could you add some more example code so I can reproduce your problem?
from org.fastnate.
Sorry, but I can't show you my example. It's a huge project, so the error may be of another cause.
I will wait for v.1.5.0 release, so this issue can be closed.
from org.fastnate.
I'm closing the issue in preparation of the 1.5.0 release. If you find, that the issue still exists with 1.5.0, feel free to reopen it again.
from org.fastnate.
Related Issues (20)
- ArrayIndexOutOfBoundsException when using SINGLE_TABLE and ConnectedStatementsWriter HOT 1
- Support @Resource in DataProvider HOT 1
- Support spatial properties
- Support java 8 local time api HOT 2
- ConnectedStatementsWriter does not respect autocommit=false of given connectionn HOT 1
- Support for Hibernate property "globally_quoted_identifiers" HOT 1
- Fastnate generating table even if Hibernate does not. HOT 2
- Attribute name bug on mapped property HOT 3
- AssociationOverride with JoinColumns defined in the JoinTable are ignored HOT 1
- Schema name doesn't get appended in the SQL statements HOT 6
- Fastnate - Spring Boot Generate the whole schema based on the entities HOT 6
- Support to create Liquibase XML file HOT 1
- Support annotation GenericGenerator HOT 4
- Support Embeddable in Collection of Embeddables HOT 1
- [Question] Is there anyway to do it using gradle instead? HOT 1
- [Question] Is it possible not to generate te relations? HOT 1
- DiscriminatorColumn+ DiscriminatorValue: A value for B_TYP was assigned twice HOT 2
- [Question] Is it possible to force write entities which already have an id? HOT 4
- Can't override table of an @ElementCollection HOT 1
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 org.fastnate.