Exception Details:
caused By:org.springframework.data.mapping.PropertyReferenceException:No property name found for type user!
At Org.springframework.data.mapping.propertypath.<init> (propertypath.java:75)
At Org.springframework.data.mapping.PropertyPath.create (propertypath.java:327)
At Org.springframework.data.mapping.PropertyPath.create (propertypath.java:307)
At Org.springframework.data.mapping.PropertyPath.from (propertypath.java:270)
At Org.springframework.data.mapping.PropertyPath.from (propertypath.java:241)
At Org.springframework.data.repository.query.parser.part.<init> (part.java:76)
At Org.springframework.data.repository.query.parser.parttree$orpart.<init> (PartTree.java:213)
At Org.springframework.data.repository.query.parser.parttree$predicate.buildtree (PartTree.java:321)
At Org.springframework.data.repository.query.parser.parttree$predicate.<init> (PartTree.java:301)
At Org.springframework.data.repository.query.parser.parttree.<init> (parttree.java:85)
At Org.springframework.data.jpa.repository.query.parttreejpaquery.<init> (PartTreeJpaQuery.java:60)
At Org.springframework.data.jpa.repository.query.jpaquerylookupstrategy$createquerylookupstrategy.resolvequery ( jpaquerylookupstrategy.java:91)
At org.springframework.data.jpa.repository.query.jpaquerylookupstrategy$ Createifnotfoundquerylookupstrategy.resolvequery (jpaquerylookupstrategy.java:168)
At org.springframework.data.jpa.repository.query.jpaquerylookupstrategy$ Abstractquerylookupstrategy.resolvequery (jpaquerylookupstrategy.java:69)
At Org.springframework.data.repository.core.support.repositoryfactorysupport$queryexecutormethodinterceptor. <init> (repositoryfactorysupport.java:320)
At Org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository ( repositoryfactorysupport.java:169)
At Org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn ( repositoryfactorybeansupport.java:224)
At Org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet ( repositoryfactorybeansupport.java:210)
At Org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet ( jparepositoryfactorybean.java:92)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( abstractautowirecapablebeanfactory.java:1612)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1549)
... More
Workaround:
User findbyloginname (String loginName);
If you adopt the JPA default naming convention, you should write
User findbyloginname (String loginName); This will default to find the LoginName property
Otherwise findbyloginname This is the Login object's Name property, if you do not want to change the name of the best add @Query annotations to write clearly
JPA Propertyreferenceexception:no Property user found for user exception