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/

  1. EntityManager em = emf.createEntityManager();
  2. em.getTransaction().begin();
  3.  
  4. 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();
  5.  
  6. for (Object[] result : results) {
  7. log.info(result[0] + " " + result[1] + " - " + result[2]);
  8. }
  9.  
  10. em.getTransaction().commit();
  11. 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

Testing
Notifications