Giter VIP home page Giter VIP logo

Comments (5)

liefke avatar liefke commented on August 27, 2024

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.

feo81 avatar feo81 commented on August 27, 2024

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.

liefke avatar liefke commented on August 27, 2024

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.

feo81 avatar feo81 commented on August 27, 2024

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.

liefke avatar liefke commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.