Est-il possible de faire des jointures externes sur les objets métiers d'une bdm ?

1
0
-1

Bonjour,
J'ai plusieurs objets métiers dans ma bdm, et je voulais savoir si c'est possible de faire des requêtes avec jointures sur ces objets. Si oui, comment faire ?
Merci

2 answers

1
0
-1
This one is the BEST answer!

Currently not within the BDM Manager

You might want to try to create your own query and execute it in a Connector once you have a defined connection.

From http://www.thoughts-on-java.org/how-to-join-unrelated-entities/

EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
       
List<Object[]> results = em.createQuery("SELECT p.firstName, p.lastName, n.phoneNumber FROM Person p LEFT JOIN PhoneBookEntry n ON p.firstName = n.firstName AND p.lastName = n.lastName").getResultList();

for (Object[] result : results) {
        log.info(result[0] + " " + result[1] + " - " + result[2]);
}

em.getTransaction().commit();
em.close();

Try it and let us know how you get on,

regards
Seán

PS: While this may not be the complete answer you're hoping for, it does indicate a possible solution, please mark as resolved.

1
0
-1

Thank you for your answer, I'll try this and let you know how it goes

Notifications