@Test public void testRelationshipName_LowerCase_Underscores() { DbRelationship r1 = makeRelationship("painting", "artist_id", "artist", "artist_id", false); assertEquals("artist", generator.relationshipName(r1)); DbRelationship r2 = makeRelationship("artist", "artist_id", "painting", "artist_id", true); assertEquals("paintings", generator.relationshipName(r2)); DbRelationship r3 = makeRelationship("person", "mother_id", "person", "person_id", false); assertEquals("mother", generator.relationshipName(r3)); DbRelationship r4 = makeRelationship("person", "person_id", "person", "mother_id", true); assertEquals("people", generator.relationshipName(r4)); DbRelationship r5 = makeRelationship("person", "shipping_address_id", "address", "id", false); assertEquals("shippingAddress", generator.relationshipName(r5)); DbRelationship r6 = makeRelationship("person", "id", "address", "person_id", true); assertEquals("addresses", generator.relationshipName(r6)); }
@Override public String relationshipName(DbRelationship... relationshipChain) { if (relationshipChain == null || relationshipChain.length < 1) { throw new IllegalArgumentException("At least on relationship is expected: " + relationshipChain); } String name = isToMany(relationshipChain) ? toManyRelationshipName(relationshipChain) : toOneRelationshipName(relationshipChain); return Util.underscoredToJava(name, false); }
DefaultObjectNameGenerator implements ObjectNameGenerator { @Override public String relationshipName(DbRelationship... relationshipChain) { if (relationshipChain == null || relationshipChain.length < 1) { throw new IllegalArgumentException("At least on relationship is expected: " + relationshipChain); } String name = isToMany(relationshipChain) ? toManyRelationshipName(relationshipChain) : toOneRelationshipName(relationshipChain); return Util.underscoredToJava(name, false); } }
DefaultObjectNameGenerator implements ObjectNameGenerator { @Override public String relationshipName(DbRelationship... relationshipChain) { if (relationshipChain == null || relationshipChain.length < 1) { throw new IllegalArgumentException("At least on relationship is expected: " + relationshipChain); } String name = isToMany(relationshipChain) ? toManyRelationshipName(relationshipChain) : toOneRelationshipName(relationshipChain); return Util.underscoredToJava(name, false); } DefaultObjectNameGenerator();  DefaultObjectNameGenerator(DbEntityNameStemmer dbEntityNameStemmer); }
DefaultObjectNameGenerator implements ObjectNameGenerator { @Override public String relationshipName(DbRelationship... relationshipChain) { if (relationshipChain == null || relationshipChain.length < 1) { throw new IllegalArgumentException("At least on relationship is expected: " + relationshipChain); } String name = isToMany(relationshipChain) ? toManyRelationshipName(relationshipChain) : toOneRelationshipName(relationshipChain); return Util.underscoredToJava(name, false); } DefaultObjectNameGenerator();  DefaultObjectNameGenerator(DbEntityNameStemmer dbEntityNameStemmer); @Override String relationshipName(DbRelationship... relationshipChain); @Override String objEntityName(DbEntity dbEntity); @Override String objAttributeName(DbAttribute attr); }
DefaultObjectNameGenerator implements ObjectNameGenerator { @Override public String relationshipName(DbRelationship... relationshipChain) { if (relationshipChain == null || relationshipChain.length < 1) { throw new IllegalArgumentException("At least on relationship is expected: " + relationshipChain); } String name = isToMany(relationshipChain) ? toManyRelationshipName(relationshipChain) : toOneRelationshipName(relationshipChain); return Util.underscoredToJava(name, false); } DefaultObjectNameGenerator();  DefaultObjectNameGenerator(DbEntityNameStemmer dbEntityNameStemmer); @Override String relationshipName(DbRelationship... relationshipChain); @Override String objEntityName(DbEntity dbEntity); @Override String objAttributeName(DbAttribute attr);  }