@Test void getSqlInsertJunctionInversedBy() { EntityType entityType = when(mock(EntityType.class).getId()).thenReturn("entity").getMock(); when(entityType.getId()).thenReturn("entityTypeId"); Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("idAttr").getMock(); when(idAttr.getIdentifier()).thenReturn("idAttrId"); Attribute attr = when(mock(Attribute.class).getName()).thenReturn("attr").getMock(); when(attr.getIdentifier()).thenReturn("attrId"); when(attr.getDataType()).thenReturn(XREF); when(attr.isInversedBy()).thenReturn(true); when(entityType.getIdAttribute()).thenReturn(idAttr); assertEquals( "INSERT INTO \"entityTypeId#c34894ba_attr\" (\"order\",\"idAttr\",\"attr\") VALUES (?,?,?)", PostgreSqlQueryGenerator.getSqlInsertJunction(entityType, attr)); }
static String getSqlInsertJunction(EntityType entityType, Attribute attr) { String junctionTableName = getJunctionTableName(entityType, attr); return "INSERT INTO " + junctionTableName + " (" + getJunctionTableOrderColumnName() + ',' + getColumnName(entityType.getIdAttribute()) + ',' + getColumnName(attr) + ") VALUES (?,?,?)"; }
PostgreSqlQueryGenerator { static String getSqlInsertJunction(EntityType entityType, Attribute attr) { String junctionTableName = getJunctionTableName(entityType, attr); return "INSERT INTO " + junctionTableName + " (" + getJunctionTableOrderColumnName() + ',' + getColumnName(entityType.getIdAttribute()) + ',' + getColumnName(attr) + ") VALUES (?,?,?)"; } }
PostgreSqlQueryGenerator { static String getSqlInsertJunction(EntityType entityType, Attribute attr) { String junctionTableName = getJunctionTableName(entityType, attr); return "INSERT INTO " + junctionTableName + " (" + getJunctionTableOrderColumnName() + ',' + getColumnName(entityType.getIdAttribute()) + ',' + getColumnName(attr) + ") VALUES (?,?,?)"; } private  PostgreSqlQueryGenerator(); }
PostgreSqlQueryGenerator { static String getSqlInsertJunction(EntityType entityType, Attribute attr) { String junctionTableName = getJunctionTableName(entityType, attr); return "INSERT INTO " + junctionTableName + " (" + getJunctionTableOrderColumnName() + ',' + getColumnName(entityType.getIdAttribute()) + ',' + getColumnName(attr) + ") VALUES (?,?,?)"; } private  PostgreSqlQueryGenerator();  }
PostgreSqlQueryGenerator { static String getSqlInsertJunction(EntityType entityType, Attribute attr) { String junctionTableName = getJunctionTableName(entityType, attr); return "INSERT INTO " + junctionTableName + " (" + getJunctionTableOrderColumnName() + ',' + getColumnName(entityType.getIdAttribute()) + ',' + getColumnName(attr) + ") VALUES (?,?,?)"; } private  PostgreSqlQueryGenerator();   }