コード例 #1
0
ファイル: EntityTest.java プロジェクト: vicktorix/NexusData
  public void testGetRelationshipsForSubSubEntity() throws Throwable {
    Entity<Contractor> contractorEntity = model.getEntity(Contractor.class);

    checkRelationships(
        contractorEntity.getRelationships(),
        Arrays.asList(
            new RelationInfo("address", "Address", null, Relationship.Type.TO_ONE),
            new RelationInfo("company", "Company", "employees", Relationship.Type.TO_ONE),
            new RelationInfo("directReports", "Employee", "manager", Relationship.Type.TO_MANY),
            new RelationInfo("manager", "Employee", "directReports", Relationship.Type.TO_ONE),
            new RelationInfo("passport", "Passport", "employee", Relationship.Type.TO_ONE)));
  }
コード例 #2
0
ファイル: EntityTest.java プロジェクト: vicktorix/NexusData
  public void testGetAttributesForBaseEntity() throws Throwable {
    Entity<Person> personEntity = model.getEntity(Person.class);

    checkAttributes(
        personEntity.getAttributes(),
        Arrays.asList(
            new AttrInfo("id", Integer.class),
            new AttrInfo("firstName", String.class),
            new AttrInfo("lastName", String.class),
            new AttrInfo("heightInCm", Float.class),
            new AttrInfo("dateOfBirth", Date.class)));
  }
コード例 #3
0
ファイル: EntityTest.java プロジェクト: vicktorix/NexusData
  public void testGetAttributesForSubEntity() throws Throwable {
    Entity<Employee> employeeEntity = model.getEntity(Employee.class);

    checkAttributes(
        employeeEntity.getAttributes(),
        Arrays.asList(
            new AttrInfo("id", Integer.class),
            new AttrInfo("firstName", String.class),
            new AttrInfo("lastName", String.class),
            new AttrInfo("heightInCm", Float.class),
            new AttrInfo("hourlyWage", Double.class),
            new AttrInfo("dateOfBirth", Date.class),
            new AttrInfo("active", Boolean.class)));
  }