[question] Not a managed type
See original GitHub issueHello!
Just stumbled upon your project and it looks quite interesting, however, I’m having a hard time wrapping my head around it. Please, help!
I use spring-data-jpa in my project and everything worked without a glitch before I’ve added blaze-persistence… My entities have UUID PK and while constructing CriteriaBuilderFactory
@Bean
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
@Lazy(false)
public CriteriaBuilderFactory createCriteriaBuilderFactory() {
CriteriaBuilderConfiguration config = Criteria.getDefault();
return config.createCriteriaBuilderFactory(entityManagerFactory);
}
I end up with exception:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.blazebit.persistence.CriteriaBuilderFactory]: Factory method 'createCriteriaBuilderFactory' threw exception; nested exception is java.lang.IllegalArgumentException: Not a managed type: class java.util.UUID
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE]
... 44 common frames omitted
Caused by: java.lang.IllegalArgumentException: Not a managed type: class java.util.UUID
at org.hibernate.jpa.internal.metamodel.MetamodelImpl.managedType(MetamodelImpl.java:210) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final]
Please advise how to overcome this issue!
Thanks in advance, Andrey
Issue Analytics
- State:
- Created 6 years ago
- Comments:32 (15 by maintainers)
Top Results From Across the Web
Spring boot - Not a managed type - Stack Overflow
If you are adding the spring boot module as a dependency in another project, make sure that the main class is not involved...
Read more >How to Fix Error "Not a managed type" in Spring - YouTube
How to fix the error: java.lang.IllegalArgumentException: Not a managed type : class com.company.EntityName you may encounter during ...
Read more >Spring Data fails with "IllegalArgumentException: Not ... - GitHub
IllegalArgumentException : Not a managed type: class com.xx.xx.model. ... unzip or git clone, build, and deploy) that reproduces the problem.
Read more >Java – Autowiring fails: Not an managed Type - iTecNote
"Not a managed bean" means not a type the JPA provider is aware of. If you're setting up a Spring based JPA application...
Read more >spring-projects/spring-boot - Gitter
IllegalArgumentException : Not an managed type: class com.thing.model. ... have multiple solutions for the same problem (accessing configuration properties).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks 😃 I talked to Markus Winand(author of the article) a few weeks ago, and figured out, that the chosen keyset pagination strategy is not yet perfect, but that will change in the final 1.2.0 version: https://github.com/Blazebit/blaze-persistence/issues/419
f you look into the core documentation there is something called implicit group by generation which is what is causing the group by being generated. This is a post step that just makes your life easier. If you want to have custom grouping or having predicates you can simply add them, on top of that, the rest of the needed group bys is added, skipping duplicates. It is by design that having is only allowed when specifying an explicit group by. Note that you don’t have the specify the full group by, just the item Id is enough.