Search in sources :

Example 16 with Individual

use of org.neo4j.ogm.domain.social.Individual in project neo4j-ogm by neo4j.

the class ArraysMappingTest method shouldGenerateCypherToPersistCollectionOfBoxedPrimitivesToArrayOfPrimitives.

@Test
public void shouldGenerateCypherToPersistCollectionOfBoxedPrimitivesToArrayOfPrimitives() {
    Individual individual = new Individual();
    individual.setName("Gary");
    individual.setAge(36);
    individual.setBankBalance(99.25f);
    individual.setFavouriteRadioStations(new Vector<>(Arrays.asList(97.4, 105.4, 98.2)));
    session.save(individual);
    session.clear();
    assertThat(session.query("MATCH (i:Individual {name:'Gary', age:36, bankBalance:99.25, code:0, favouriteRadioStations:[97.4, 105.4, 98.2]}) " + "return i", emptyMap()).queryResults()).hasSize(1);
}
Also used : Individual(org.neo4j.ogm.domain.social.Individual) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)16 Individual (org.neo4j.ogm.domain.social.Individual)16 Map (java.util.Map)3 SessionFactory (org.neo4j.ogm.session.SessionFactory)3 HashMap (java.util.HashMap)2 NodeModel (org.neo4j.ogm.response.model.NodeModel)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Filter (org.neo4j.ogm.cypher.Filter)1 Statement (org.neo4j.ogm.request.Statement)1 Session (org.neo4j.ogm.session.Session)1