Regarding Cyper query exception

26 views
Skip to first unread message

gokulakanna balakrishnan

unread,
May 17, 2012, 9:08:21 AM5/17/12
to Neo4j
Hi All,

I am getting below exception when i added cyber query in my
repository.

Please find the exceptin below.

Caused by: java.lang.IllegalArgumentException: No property get found
for type class com.letzplay.domain.Tournament
at
org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:
73)
at
org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:
92)
at
org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:
312)
at
org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:
326)
at
org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:
326)
at
org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:
294)
at
org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:
258)
at
org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:
239)
at
org.springframework.data.repository.query.parser.Part.<init>(Part.java:
69)
at org.springframework.data.repository.query.parser.PartTree
$OrPart.<init>(PartTree.java:180)
at org.springframework.data.repository.query.parser.PartTree
$Predicate.buildTree(PartTree.java:260)
at org.springframework.data.repository.query.parser.PartTree
$Predicate.<init>(PartTree.java:240)
at
org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:
68)
at
org.springframework.data.neo4j.repository.query.DerivedCypherRepositoryQuery.<init>(DerivedCypherRepositoryQuery.java:
51)
at
org.springframework.data.neo4j.repository.query.GraphQueryMethod.createQuery(GraphQueryMethod.java:
121)
at org.springframework.data.neo4j.repository.GraphRepositoryFactory
$1.resolveQuery(GraphRepositoryFactory.java:113)
at
org.springframework.data.repository.core.support.RepositoryFactorySupport
$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:
268)
at
org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:
142)
at
org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:
114)
at
org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:
38)
at
org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:
142)public interface TournamentRepository extends

GraphRepository<Tournament>,RelationshipOperationsRepository<Tournament>
{

//start
tournament=node:__types__(className="com.letzplay.domain.Tournament")
where tournament.status = {0} return tournament
public Iterable<Tournament> getAllTournament(String status);


}

Thanks & Regards,
Gokul

Michael Hunger

unread,
May 17, 2012, 9:50:17 AM5/17/12
to ne...@googlegroups.com
it should look like for automatic derived queries.
> Iterable<Tournament> findByStatus(String status);
or if you want to use a manual query:

@Query("tournament=node:__types__(className="com.letzplay.domain.Tournament") where tournament.status = {0} return tournament")
> Iterable<Tournament> getAllTournament(String status);


Might make sense to index status if that is an important query.

Michael

gokulakanna balakrishnan

unread,
May 17, 2012, 10:13:32 AM5/17/12
to ne...@googlegroups.com
Hi Michael,

I am getting compile time exception. I have attached screen shot.
Please find the attachment.

Thanks & Regards,
Gokul
cyper.png

gokulakanna balakrishnan

unread,
May 17, 2012, 10:38:15 AM5/17/12
to ne...@googlegroups.com
Hi Michael,

I have to select the tournament based status and
tournamentStartDate. That is why I used manual query

@Query("start
tournament=node:__types__(className="com.letzplay.domain.Tournament")
where tournament.status = {0} and tourmanet.startDate={1} return
tournament")

This is giving compite time exception.

I have modified query like below. Its giving run time exception.
Please find the attachement.

@Query("start
tournament=node:__types__(className=com.letzplay.domain.Tournament)
where tournament.status = {0} return tournament") - Its not giving
compile time exception but its giving runtime exception

Thanks & Regards,
Gokul

On Thu, May 17, 2012 at 7:20 PM, Michael Hunger
<michael...@neotechnology.com> wrote:
> it should look like for automatic derived queries.
>> Iterable<Tournament> findByStatus(String status);
> or if you want to use a manual query:
>
> @Query("tournament=node:__types__(className="com.letzplay.domain.Tournament") where tournament.status = {0} return tournament")
>> Iterable<Tournament> getAllTournament(String status);
>.
cyperquery_run_time_exception.png

Michael Hunger

unread,
May 17, 2012, 10:55:21 AM5/17/12
to ne...@googlegroups.com
Escape your quotes.
> <cyperquery_run_time_exception.png>

gokulakanna balakrishnan

unread,
May 17, 2012, 11:25:56 AM5/17/12
to ne...@googlegroups.com
Its working fine Michael. Thanks a lot Michael.

On Thu, May 17, 2012 at 8:25 PM, Michael Hunger
Reply all
Reply to author
Forward
0 new messages