@Test public void testMatchingForManyToManyEntity() throws Exception { ObjEntity manyToManyEntity = map.getObjEntity("Table1Table2"); assertNotNull(ManyToManyCandidateEntity.build(manyToManyEntity)); }
public static ManyToManyCandidateEntity build(ObjEntity joinEntity) { ArrayList<ObjRelationship> relationships = new ArrayList<>(joinEntity.getRelationships()); if (relationships.size() != 2 || (relationships.get(0).getDbRelationships().isEmpty() || relationships.get(1).getDbRelationships().isEmpty())) { return null; } ManyToManyCandidateEntity candidateEntity = new ManyToManyCandidateEntity(joinEntity, relationships); if (candidateEntity.isManyToMany()) { return candidateEntity; } return null; }
ManyToManyCandidateEntity { public static ManyToManyCandidateEntity build(ObjEntity joinEntity) { ArrayList<ObjRelationship> relationships = new ArrayList<>(joinEntity.getRelationships()); if (relationships.size() != 2 || (relationships.get(0).getDbRelationships().isEmpty() || relationships.get(1).getDbRelationships().isEmpty())) { return null; } ManyToManyCandidateEntity candidateEntity = new ManyToManyCandidateEntity(joinEntity, relationships); if (candidateEntity.isManyToMany()) { return candidateEntity; } return null; } }
ManyToManyCandidateEntity { public static ManyToManyCandidateEntity build(ObjEntity joinEntity) { ArrayList<ObjRelationship> relationships = new ArrayList<>(joinEntity.getRelationships()); if (relationships.size() != 2 || (relationships.get(0).getDbRelationships().isEmpty() || relationships.get(1).getDbRelationships().isEmpty())) { return null; } ManyToManyCandidateEntity candidateEntity = new ManyToManyCandidateEntity(joinEntity, relationships); if (candidateEntity.isManyToMany()) { return candidateEntity; } return null; } private  ManyToManyCandidateEntity(ObjEntity entityValue, List<ObjRelationship> relationships); }
ManyToManyCandidateEntity { public static ManyToManyCandidateEntity build(ObjEntity joinEntity) { ArrayList<ObjRelationship> relationships = new ArrayList<>(joinEntity.getRelationships()); if (relationships.size() != 2 || (relationships.get(0).getDbRelationships().isEmpty() || relationships.get(1).getDbRelationships().isEmpty())) { return null; } ManyToManyCandidateEntity candidateEntity = new ManyToManyCandidateEntity(joinEntity, relationships); if (candidateEntity.isManyToMany()) { return candidateEntity; } return null; } private  ManyToManyCandidateEntity(ObjEntity entityValue, List<ObjRelationship> relationships); static ManyToManyCandidateEntity build(ObjEntity joinEntity); void optimizeRelationships(ObjectNameGenerator nameGenerator); }
ManyToManyCandidateEntity { public static ManyToManyCandidateEntity build(ObjEntity joinEntity) { ArrayList<ObjRelationship> relationships = new ArrayList<>(joinEntity.getRelationships()); if (relationships.size() != 2 || (relationships.get(0).getDbRelationships().isEmpty() || relationships.get(1).getDbRelationships().isEmpty())) { return null; } ManyToManyCandidateEntity candidateEntity = new ManyToManyCandidateEntity(joinEntity, relationships); if (candidateEntity.isManyToMany()) { return candidateEntity; } return null; } private  ManyToManyCandidateEntity(ObjEntity entityValue, List<ObjRelationship> relationships); static ManyToManyCandidateEntity build(ObjEntity joinEntity); void optimizeRelationships(ObjectNameGenerator nameGenerator);  }