dimanche 19 juillet 2015

Android - How do I retrieve fields of 2 or more tables using ORMLite?

I have table A and table B, which are related (1 to N).

I'd like this query to be automatically generated by ORMLite:

SELECT tableA.*, tableB.fieldX, tableB.fieldY
FROM tableA, tableB
LEFT JOIN tableB
ON tableA.ID=tableB.foreignID;

I've successfully done the LEFT JOIN part by simply doing:

builderTableA.leftJoin(builderTableB);

But the SELECT and FROM statements generated by ORMLite always look like:

SELECT * from TABLE A ...

How can I retrieve some fields of table B on the select statement using ORMLite??

Aucun commentaire:

Enregistrer un commentaire