@Test void getTableAttributes() throws Exception { EntityType entityType = when(mock(EntityType.class).getId()).thenReturn("entity").getMock(); Attribute stringAttr = mock(Attribute.class); when(stringAttr.getDataType()).thenReturn(STRING); Attribute mrefAttr = mock(Attribute.class); when(mrefAttr.getDataType()).thenReturn(MREF); Attribute mrefAttrWithExpression = mock(Attribute.class); when(mrefAttrWithExpression.getDataType()).thenReturn(MREF); when(mrefAttrWithExpression.getExpression()).thenReturn("expression"); Attribute xrefAttr = mock(Attribute.class); when(xrefAttr.getDataType()).thenReturn(XREF); Attribute xrefAttrInversedBy = mock(Attribute.class); when(xrefAttrInversedBy.getDataType()).thenReturn(XREF); when(xrefAttrInversedBy.isInversedBy()).thenReturn(true); Attribute refAttr = mock(Attribute.class); when(refAttr.getDataType()).thenReturn(ONE_TO_MANY); when(xrefAttrInversedBy.getInversedBy()).thenReturn(refAttr); when(entityType.getAtomicAttributes()) .thenReturn( newArrayList( stringAttr, mrefAttr, mrefAttrWithExpression, xrefAttr, xrefAttrInversedBy)); List<Attribute> junctionTableAttrs = newArrayList(stringAttr, xrefAttr, xrefAttrInversedBy); assertEquals( junctionTableAttrs, PostgreSqlQueryUtils.getTableAttributes(entityType).collect(toList())); }
static Stream<Attribute> getTableAttributes(EntityType entityType) { return getPersistedAttributes(entityType).filter(PostgreSqlQueryUtils::isTableAttribute); }
PostgreSqlQueryUtils { static Stream<Attribute> getTableAttributes(EntityType entityType) { return getPersistedAttributes(entityType).filter(PostgreSqlQueryUtils::isTableAttribute); } }
PostgreSqlQueryUtils { static Stream<Attribute> getTableAttributes(EntityType entityType) { return getPersistedAttributes(entityType).filter(PostgreSqlQueryUtils::isTableAttribute); } private  PostgreSqlQueryUtils(); }
PostgreSqlQueryUtils { static Stream<Attribute> getTableAttributes(EntityType entityType) { return getPersistedAttributes(entityType).filter(PostgreSqlQueryUtils::isTableAttribute); } private  PostgreSqlQueryUtils();  }
PostgreSqlQueryUtils { static Stream<Attribute> getTableAttributes(EntityType entityType) { return getPersistedAttributes(entityType).filter(PostgreSqlQueryUtils::isTableAttribute); } private  PostgreSqlQueryUtils();   }