Search in sources :

Example 51 with User

use of org.neo4j.ogm.domain.gh368.User in project mybatis-issues by harawata.

the class ConfPropWithSpringTest method shouldInsertAUser.

@Test
public void shouldInsertAUser() {
    User user = new User();
    user.setId(2);
    user.setName("User2");
    mapper.insertUser(user);
}
Also used : User(issue723.User) Test(org.junit.Test)

Example 52 with User

use of org.neo4j.ogm.domain.gh368.User in project neo4j-ogm by neo4j.

the class DeepNestQueryingOfRelationshipEntitiesIntegrationTest method flattenedPathSegmentsShouldWorkFromBothEnds.

@Test
public void flattenedPathSegmentsShouldWorkFromBothEnds() {
    Filter outgoing = new Filter("name", ComparisonOperator.EQUALS, "U1");
    outgoing.setOwnerEntityType(GroupMember.class);
    outgoing.setNestedPath(new Filter.NestedPathSegment("user", User.class));
    Filter incoming = new Filter("name", ComparisonOperator.EQUALS, "EuregJUG");
    incoming.setOwnerEntityType(GroupMember.class);
    incoming.setNestedPath(new Filter.NestedPathSegment("group", UserGroup.class));
    Collection<GroupMember> members = sessionFactory.openSession().loadAll(GroupMember.class, outgoing.and(incoming));
    assertThat(members).hasSize(1);
}
Also used : GroupMember(org.neo4j.ogm.domain.gh824.GroupMember) User(org.neo4j.ogm.domain.gh824.User) Filter(org.neo4j.ogm.cypher.Filter) UserGroup(org.neo4j.ogm.domain.gh824.UserGroup) Test(org.junit.Test)

Example 53 with User

use of org.neo4j.ogm.domain.gh368.User in project neo4j-ogm by neo4j.

the class DeepNestQueryingOfRelationshipEntitiesIntegrationTest method createData.

@Before
public void createData() {
    sessionFactory.openSession().purgeDatabase();
    Address a1 = new Address();
    a1.setCode("0001");
    Address a2 = new Address();
    a2.setCode("0002");
    City aachen = new City("Aachen");
    City koeln = new City("Köln");
    a2.setCity(aachen);
    User u1 = new User("U1");
    u1.setAddress(a1);
    User u2 = new User("Mr. User");
    u2.setAddress(a1);
    User u3 = new User();
    u3.setAddress(a2);
    UserGroup ug1 = new UserGroup();
    ug1.setCity(aachen);
    ug1.setName("EuregJUG");
    UserGroup ug2 = new UserGroup();
    ug2.setCity(koeln);
    ug2.setName("JUG Köln");
    List<GroupMember> members = Arrays.asList(new GroupMember(u1, ug1), new GroupMember(u2, ug2), new GroupMember(u3, ug2));
    Session session = sessionFactory.openSession();
    members.forEach(session::save);
}
Also used : GroupMember(org.neo4j.ogm.domain.gh824.GroupMember) User(org.neo4j.ogm.domain.gh824.User) Address(org.neo4j.ogm.domain.gh824.Address) City(org.neo4j.ogm.domain.gh824.City) UserGroup(org.neo4j.ogm.domain.gh824.UserGroup) Session(org.neo4j.ogm.session.Session) Before(org.junit.Before)

Example 54 with User

use of org.neo4j.ogm.domain.gh368.User in project neo4j-ogm by neo4j.

the class DeepNestQueryingOfRelationshipEntitiesIntegrationTest method nPlus1PathSegmentsShouldWork.

@Test
public void nPlus1PathSegmentsShouldWork() {
    Filter filter = new Filter("name", ComparisonOperator.EQUALS, "Aachen");
    filter.setOwnerEntityType(GroupMember.class);
    filter.setNestedPath(new Filter.NestedPathSegment("user", User.class), new Filter.NestedPathSegment("address", Address.class), new Filter.NestedPathSegment("city", City.class));
    Collection<GroupMember> members = sessionFactory.openSession().loadAll(GroupMember.class, filter);
    assertThat(members).hasSize(1);
}
Also used : GroupMember(org.neo4j.ogm.domain.gh824.GroupMember) User(org.neo4j.ogm.domain.gh824.User) Address(org.neo4j.ogm.domain.gh824.Address) Filter(org.neo4j.ogm.cypher.Filter) City(org.neo4j.ogm.domain.gh824.City) Test(org.junit.Test)

Example 55 with User

use of org.neo4j.ogm.domain.gh368.User in project neo4j-ogm by neo4j.

the class DeepNestQueryingOfRelationshipEntitiesIntegrationTest method nPathSegmentsShouldWorkFromBothEnds.

@Test
public void nPathSegmentsShouldWorkFromBothEnds() {
    Filter outgoing = new Filter("code", ComparisonOperator.EQUALS, "0001");
    outgoing.setOwnerEntityType(GroupMember.class);
    outgoing.setNestedPath(new Filter.NestedPathSegment("user", User.class), new Filter.NestedPathSegment("address", Address.class));
    Filter incoming = new Filter("name", ComparisonOperator.EQUALS, "Aachen");
    incoming.setOwnerEntityType(GroupMember.class);
    incoming.setNestedPath(new Filter.NestedPathSegment("group", UserGroup.class), new Filter.NestedPathSegment("city", City.class));
    Collection<GroupMember> members = sessionFactory.openSession().loadAll(GroupMember.class, outgoing.and(incoming));
    assertThat(members).hasSize(1);
}
Also used : GroupMember(org.neo4j.ogm.domain.gh824.GroupMember) User(org.neo4j.ogm.domain.gh824.User) Address(org.neo4j.ogm.domain.gh824.Address) Filter(org.neo4j.ogm.cypher.Filter) City(org.neo4j.ogm.domain.gh824.City) UserGroup(org.neo4j.ogm.domain.gh824.UserGroup) Test(org.junit.Test)

Aggregations

User (pl.plajer.villagedefense3.User)30 Player (org.bukkit.entity.Player)18 User (org.gluu.oxtrust.model.scim2.User)17 Test (org.junit.Test)17 User (org.openstack4j.model.identity.v3.User)13 EventHandler (org.bukkit.event.EventHandler)11 GluuCustomPerson (org.gluu.oxtrust.model.GluuCustomPerson)10 ScimPatchUser (org.gluu.oxtrust.model.scim2.ScimPatchUser)10 Date (java.util.Date)9 Arena (pl.plajer.villagedefense3.arena.Arena)8 User (me.zhanghai.android.douya.network.api.info.apiv2.User)7 User (com.google.api.ads.admanager.axis.v202202.User)6 SimpleUser (me.zhanghai.android.douya.network.api.info.apiv2.SimpleUser)6 DuplicateEntryException (org.gluu.site.ldap.exception.DuplicateEntryException)6 Test (org.junit.jupiter.api.Test)6 ArrayList (java.util.ArrayList)5 Path (javax.ws.rs.Path)5 User (org.apache.archiva.redback.rest.api.model.v2.User)5 UserInfo (org.apache.archiva.redback.rest.api.model.v2.UserInfo)5 PersonRequiredFieldsException (org.gluu.oxtrust.exception.PersonRequiredFieldsException)5