Can i return two node entities through cypher query in SDN?
for ex:
@Query( "START n=node:search({0}) RETURN n")
Iterable<User> doBasicSearch(String query);
Apart from Iterable of one Node Entity, can i give a object which has User
and Product?
like this,
Class Result {
Iterable<User> users;
Iterable<Product> products;
}
Result doBasicSearch(String query);
Kindly let me know on how to achieve this through Spring Data Neo4j.
These are versions i have included in pom,
<spring-data-neo4j.version>2.1.0.RC4</spring-data-neo4j.version>
<org.jackson-version>1.9.7</org.jackson-version>
<neo4j.version>1.8.RC1</neo4j.version>
> Can i return two node entities through cypher query in SDN?
> for ex:
> @Query( "START n=node:search({0}) RETURN n")
> Iterable<User> doBasicSearch(String query);
> Apart from Iterable of one Node Entity, can i give a object which has User and Product?
> like this,
> Class Result {
> Iterable<User> users;
> Iterable<Product> products;
> }
> Result doBasicSearch(String query);
> Kindly let me know on how to achieve this through Spring Data Neo4j. > These are versions i have included in pom,
> <spring-data-neo4j.version>2.1.0.RC4</spring-data-neo4j.version>
> <org.jackson-version>1.9.7</org.jackson-version>
> <neo4j.version>1.8.RC1</neo4j.version>
This one looks great!
However, there is no mention of this in spring-data-neo4j documentation
except in one example of 17.1.
This would drag more attention, If this could be part of "Reference
Documentation" part.
> Am 09.10.2012 um 05:41 schrieb Abdul Azeez Shaik <azeeztechni...@gmail.com
> >:
> Hi,
> Can i return two node entities through cypher query in SDN?
> for ex:
> @Query( "START n=node:search({0}) RETURN n")
> Iterable<User> doBasicSearch(String query);
> Apart from Iterable of one Node Entity, can i give a object which has User
> and Product?
> like this,
> Class Result {
> Iterable<User> users;
> Iterable<Product> products;
> }
> Result doBasicSearch(String query);
> Kindly let me know on how to achieve this through Spring Data Neo4j.
> These are versions i have included in pom,
> <spring-data-neo4j.version>2.1.0.RC4</spring-data-neo4j.version>
> <org.jackson-version>1.9.7</org.jackson-version>
> <neo4j.version>1.8.RC1</neo4j.version>
> This one looks great!
> However, there is no mention of this in spring-data-neo4j documentation except in one example of 17.1.
> This would drag more attention, If this could be part of "Reference Documentation" part.
> Thanks for providing me this option.
> Regards,
> Abdul
> On Tue, Oct 9, 2012 at 11:32 AM, Michael Hunger <michael.hun...@neotechnology.com> wrote:
> You mean two different node-entities?
> What is your use-case?
> Am 09.10.2012 um 05:41 schrieb Abdul Azeez Shaik <azeeztechni...@gmail.com>:
>> Hi,
>> Can i return two node entities through cypher query in SDN?
>> for ex:
>> @Query( "START n=node:search({0}) RETURN n")
>> Iterable<User> doBasicSearch(String query);
>> Apart from Iterable of one Node Entity, can i give a object which has User and Product?
>> like this,
>> Class Result {
>> Iterable<User> users;
>> Iterable<Product> products;
>> }
>> Result doBasicSearch(String query);
>> Kindly let me know on how to achieve this through Spring Data Neo4j. >> These are versions i have included in pom,
>> <spring-data-neo4j.version>2.1.0.RC4</spring-data-neo4j.version>
>> <org.jackson-version>1.9.7</org.jackson-version>
>> <neo4j.version>1.8.RC1</neo4j.version>
Apart from @MapResult, there is other form of Return type
Iterable<Map<String,Object>>
1.Can i use this return type to return one column and one entity?
For ex: Query("START n=node:username(username= {0}) MATCH n-[]-user RETURN
n.name, user"). Can i use Iterable<Map<String, Object>> for above query. Or
do i need to use @MapResult even for this?
2. In Neo4j(.i.e.without using SDN), Map is results of column names with
the respective data. But, in case of SDN, they will be directly associated
to @NodeEntity, so what could be the use cases where we can use
Iterable<Map<String, Object>>.
Kindly help me in understanding above result types.
> Am 09.10.2012 um 05:41 schrieb Abdul Azeez Shaik <azeeztechni...@gmail.com
> >:
> Hi,
> Can i return two node entities through cypher query in SDN?
> for ex:
> @Query( "START n=node:search({0}) RETURN n")
> Iterable<User> doBasicSearch(String query);
> Apart from Iterable of one Node Entity, can i give a object which has User
> and Product?
> like this,
> Class Result {
> Iterable<User> users;
> Iterable<Product> products;
> }
> Result doBasicSearch(String query);
> Kindly let me know on how to achieve this through Spring Data Neo4j.
> These are versions i have included in pom,
> <spring-data-neo4j.version>2.1.0.RC4</spring-data-neo4j.version>
> <org.jackson-version>1.9.7</org.jackson-version>
> <neo4j.version>1.8.RC1</neo4j.version>
Am 13.10.2012 um 11:30 schrieb Abdul Azeez Shaik <azeeztechni...@gmail.com>:
> Hi Michael,
> Apart from @MapResult, there is other form of Return type Iterable<Map<String,Object>>
> 1.Can i use this return type to return one column and one entity?
Yes
> For ex: Query("START n=node:username(username= {0}) MATCH n-[]-user RETURN n.name, user"). Can i use Iterable<Map<String, Object>> for above query. Or do i need to use @MapResult even for this?
No mapresult is just a thin wrapper around this for convenience
> 2. In Neo4j(.i.e.without using SDN), Map is results of column names with the respective data. But, in case of SDN, they will be directly associated to @NodeEntity, so what could be the use cases where we can use Iterable<Map<String, Object>>.
Here each map reprents a row mappin the column name to the object.
> Kindly help me in understanding above result types.
> Thanks,
> Abdul
> On Tue, Oct 9, 2012 at 11:32 AM, Michael Hunger <michael.hun...@neotechnology.com> wrote:
>> You mean two different node-entities?
>> What is your use-case?
>> Am 09.10.2012 um 05:41 schrieb Abdul Azeez Shaik <azeeztechni...@gmail.com>:
>>> Hi,
>>> Can i return two node entities through cypher query in SDN?
>>> for ex:
>>> @Query( "START n=node:search({0}) RETURN n")
>>> Iterable<User> doBasicSearch(String query);
>>> Apart from Iterable of one Node Entity, can i give a object which has User and Product?
>>> like this,
>>> Class Result {
>>> Iterable<User> users;
>>> Iterable<Product> products;
>>> }
>>> Result doBasicSearch(String query);
>>> Kindly let me know on how to achieve this through Spring Data Neo4j. >>> These are versions i have included in pom,
>>> <spring-data-neo4j.version>2.1.0.RC4</spring-data-neo4j.version>
>>> <org.jackson-version>1.9.7</org.jackson-version>
>>> <neo4j.version>1.8.RC1</neo4j.version>
I just tried following query ("START n=node:username(username= {0}) MATCH
n-[]-user RETURN n.name, user") with Result type as Iterable<Map<String,
User>>.
User is NodeEntity in my code.
However, instead of returning USER object, it returned
org.neo4j.rest.graphdb.entity.RestNode type. Can you please let me know if
i need to add anything specific here.
Before this, i just had Iterable<User> which use to work fine.
> Am 13.10.2012 um 11:30 schrieb Abdul Azeez Shaik <azeeztechni...@gmail.com
> >:
> Hi Michael,
> Apart from @MapResult, there is other form of Return type
> Iterable<Map<String,Object>>
> 1.Can i use this return type to return one column and one entity?
> Yes
> For ex: Query("START n=node:username(username= {0}) MATCH n-[]-user RETURN
> n.name, user"). Can i use Iterable<Map<String, Object>> for above query.
> Or do i need to use @MapResult even for this?
> No mapresult is just a thin wrapper around this for convenience
> 2. In Neo4j(.i.e.without using SDN), Map is results of column names with
> the respective data. But, in case of SDN, they will be directly associated
> to @NodeEntity, so what could be the use cases where we can use
> Iterable<Map<String, Object>>.
> Here each map reprents a row mappin the column name to the object.
> Kindly help me in understanding above result types.
> Thanks,
> Abdul
> On Tue, Oct 9, 2012 at 11:32 AM, Michael Hunger <
> michael.hun...@neotechnology.com> wrote:
>> You mean two different node-entities?
>> What is your use-case?
>> Am 09.10.2012 um 05:41 schrieb Abdul Azeez Shaik <
>> azeeztechni...@gmail.com>:
>> Hi,
>> Can i return two node entities through cypher query in SDN?
>> for ex:
>> @Query( "START n=node:search({0}) RETURN n")
>> Iterable<User> doBasicSearch(String query);
>> Apart from Iterable of one Node Entity, can i give a object which has
>> User and Product?
>> like this,
>> Class Result {
>> Iterable<User> users;
>> Iterable<Product> products;
>> }
>> Result doBasicSearch(String query);
>> Kindly let me know on how to achieve this through Spring Data Neo4j.
>> These are versions i have included in pom,
>> <spring-data-neo4j.version>2.1.0.RC4</spring-data-neo4j.version>
>> <org.jackson-version>1.9.7</org.jackson-version>
>> <neo4j.version>1.8.RC1</neo4j.version>
> I just tried following query ("START n=node:username(username= {0}) MATCH n-[]-user RETURN n.name, user") with Result type as Iterable<Map<String, User>>.
> User is NodeEntity in my code.
> However, instead of returning USER object, it returned org.neo4j.rest.graphdb.entity.RestNode type. Can you please let me know if i need to add anything specific here.
> Before this, i just had Iterable<User> which use to work fine.
> Kindly let me know your opinion on this.
> Thanks,
> Abdul
> On Sat, Oct 13, 2012 at 3:58 PM, Michael Hunger <michael.hun...@neopersistence.com> wrote:
>> Sent from mobile device
>> Am 13.10.2012 um 11:30 schrieb Abdul Azeez Shaik <azeeztechni...@gmail.com>:
>>> Hi Michael,
>>> Apart from @MapResult, there is other form of Return type Iterable<Map<String,Object>>
>>> 1.Can i use this return type to return one column and one entity?
>> Yes
>>> For ex: Query("START n=node:username(username= {0}) MATCH n-[]-user RETURN n.name, user"). Can i use Iterable<Map<String, Object>> for above query. Or do i need to use @MapResult even for this?
>> No mapresult is just a thin wrapper around this for convenience
>>> 2. In Neo4j(.i.e.without using SDN), Map is results of column names with the respective data. But, in case of SDN, they will be directly associated to @NodeEntity, so what could be the use cases where we can use Iterable<Map<String, Object>>.
>> Here each map reprents a row mappin the column name to the object.
>>> Kindly help me in understanding above result types.
>>> Thanks,
>>> Abdul
>>> On Tue, Oct 9, 2012 at 11:32 AM, Michael Hunger <michael.hun...@neotechnology.com> wrote:
>>>> You mean two different node-entities?
>>>> What is your use-case?
>>>> Am 09.10.2012 um 05:41 schrieb Abdul Azeez Shaik <azeeztechni...@gmail.com>:
>>>>> Hi,
>>>>> Can i return two node entities through cypher query in SDN?
>>>>> for ex:
>>>>> @Query( "START n=node:search({0}) RETURN n")
>>>>> Iterable<User> doBasicSearch(String query);
>>>>> Apart from Iterable of one Node Entity, can i give a object which has User and Product?
>>>>> like this,
>>>>> Class Result {
>>>>> Iterable<User> users;
>>>>> Iterable<Product> products;
>>>>> }
>>>>> Result doBasicSearch(String query);
>>>>> Kindly let me know on how to achieve this through Spring Data Neo4j. >>>>> These are versions i have included in pom,
>>>>> <spring-data-neo4j.version>2.1.0.RC4</spring-data-neo4j.version>
>>>>> <org.jackson-version>1.9.7</org.jackson-version>
>>>>> <neo4j.version>1.8.RC1</neo4j.version>