question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MappedSuperclass annotation issue

See original GitHub issue

Hi, I am using 1.11.03 and I have the spring configuration in xml in this way:

	<jpa:repositories base-package="my.package.datamodel.repositories"
	                  factory-class="com.cosium.spring.data.jpa.entity.graph.repository.support.EntityGraphJpaRepositoryFactoryBean"
	                  entity-manager-factory-ref="entityManagerFactory" />

I have some classes annotated with @MappedSuperclass and I have this issue:

java.lang.IllegalArgumentException: Not an entity: class com.liberologico.cloudesire.datamodel.entities.MetadataEntity
	at org.hibernate.metamodel.internal.MetamodelImpl.entity(MetamodelImpl.java:456)
	at org.hibernate.metamodel.internal.MetamodelImpl.findEntityGraphsByType(MetamodelImpl.java:687)
	at org.hibernate.internal.SessionFactoryImpl.findEntityGraphsByType(SessionFactoryImpl.java:545)
	at org.hibernate.internal.SessionImpl.getEntityGraphs(SessionImpl.java:3856)
	at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:347) [3 skipped]
	at com.sun.proxy.$Proxy166.getEntityGraphs(Unknown Source)
	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:298) [3 skipped]
	at com.sun.proxy.$Proxy166.getEntityGraphs(Unknown Source)
	at com.cosium.spring.data.jpa.entity.graph.repository.support.RepositoryEntityManagerEntityGraphInjector.invoke(RepositoryEntityManagerEntityGraphInjector.java:59) [6 skipped]
	at com.sun.proxy.$Proxy169.getEntityGraphs(Unknown Source) [2 skipped]
	at com.cosium.spring.data.jpa.entity.graph.repository.support.RepositoryMethodEntityGraphExtractor$JpaEntityGraphMethodInterceptor.findDefaultEntityGraph(RepositoryMethodEntityGraphExtractor.java:88)
	at com.cosium.spring.data.jpa.entity.graph.repository.support.RepositoryMethodEntityGraphExtractor$JpaEntityGraphMethodInterceptor.<init>(RepositoryMethodEntityGraphExtractor.java:79)
	at com.cosium.spring.data.jpa.entity.graph.repository.support.RepositoryMethodEntityGraphExtractor.postProcess(RepositoryMethodEntityGraphExtractor.java:46)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
reda-alaouicommented, Dec 1, 2017

Ok thanks for the feedback 👍

1reaction
reda-alaouicommented, Nov 21, 2017

Hi @pimuzzo ,

Can you show me the used repository class and repository method call that generates this exception?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is the MappedSuperClass annotation no longer valid in ...
The mapping is incorrect according to the JPA 2.2 specification, @MappedSuperclass and @Inheritance cannot be used together. · To solve the issue ...
Read more >
How to inherit properties from a base class entity using ...
The JPA standard specification defines the @MappedSuperclass annotation to allow an entity to inherit properties from a base class.
Read more >
Wrong inspection error when using `@MappedSuperclass` in ...
This issue is originally about the case, that Entity classes with Id field defined in their superclasses [annotated with @MappedSuperclass ] are marked...
Read more >
MappedSuperclass (Java EE 5 SDK) - Oracle Help Center
Mapping information may be overridden in such subclasses by using the AttributeOverride and AssociationOverride annotations or corresponding XML elements.
Read more >
Mapped superclass in JPA on waitingforcode.com
This annotation is @MappedSuperclass. This exceptions proves well that you can't manage JPA mapping in simple POJO classes, not annotated with @Entity or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found