@Test public void determineJoinTableName() { final ImplicitJoinTableNameSource source = Mockito.mock(ImplicitJoinTableNameSource.class); mockContext(source); final AttributePath attributePath= Mockito.mock(AttributePath.class); Mockito.when(attributePath.getProperty()).thenReturn("myProperty"); Mockito.when(source.getAssociationOwningAttributePath()).thenReturn(attributePath); Mockito.when(source.getOwningPhysicalTableName()).thenReturn("Table1"); final Identifier identifier = new ImplicitNamingStrategyNiceJpaImpl().determineJoinTableName(source); Assert.assertEquals("Table1_my_property", identifier.getText()); }
@Override public Identifier determineJoinTableName(ImplicitJoinTableNameSource source) { String name = source.getOwningPhysicalTableName() + "_" + source.getAssociationOwningAttributePath().getProperty(); return toIdentifier(name, source.getBuildingContext()); }
@Override public Identifier determineJoinTableName(final ImplicitJoinTableNameSource source) { final String name = source.getOwningPhysicalTableName() + '_' + transformAttributePath(source.getAssociationOwningAttributePath()); return toIdentifier(name, source.getBuildingContext()); }