I want to select fields from two tables with Speedment ORM, and show registers by System.out.println.
This is my main query:
return AMDB.INSTANCE.interface_Manager().stream().filter(Interface_.INTERFACEID.contains(s))
.map(AMDB.INSTANCE.abstractcomponentManager().finderBy(Interface_.INTERFACE_COMPONENT_E_ID))
.flatMap(AMDB.INSTANCE.concretecomponentManager().finderBackwardsBy(Concretecomponent.ABSTRACTCOMPONENT_E_ID))
.map(cc -> cc.getConcretecomponentCamCamid())
.collect(Collectors.toList());
And I want to get/select fields from diferent tables:
StreamComposition.concatAndAutoClose(
AMDB.INSTANCE.interface_Manager().stream().filter(Interface_.INTERFACEID.contains(s))
.map(i -> i.getInterfaceid()),
AMDB.INSTANCE.interface_Manager().stream().filter(Interface_.INTERFACEID.contains(s))
.map(AMDB.INSTANCE.abstractcomponentManager().finderBy(Interface_.INTERFACE_COMPONENT_E_ID))
.map(ac -> ac.getComponentname()),
AMDB.INSTANCE.interface_Manager().stream().filter(Interface_.INTERFACEID.contains(s))
.map(AMDB.INSTANCE.abstractcomponentManager().finderBy(Interface_.INTERFACE_COMPONENT_E_ID))
.flatMap(AMDB.INSTANCE.concretecomponentManager().finderBackwardsBy(Concretecomponent.ABSTRACTCOMPONENT_E_ID))
.map(cc -> cc.getConcretecomponentCamCamid())
).forEachOrdered(System.out::println);
Maybe as:
SELECT * FROM table1 INNER JOIN tabl2 ON table1.id = table2.id
or
FROM table1, table2
I have found one way:
Map<Abstractcomponent, List<Interface_>> map0 = AMDB.INSTANCE.interface_Manager().stream().filter(Interface_.INTERFACEID.contains(s))
.collect(Collectors.groupingBy(AMDB.INSTANCE.abstractcomponentManager().finderBy(Interface_.INTERFACE_COMPONENT_E_ID)));
But I want to achieve the fields from last joining table with the values Map<String, List<Interface_>>,
where the "String is a field from "concretecomponentManager" table