I try to export all Objects in an Flatfile-Hiearchy (.csv).
But only the first exported Table contains all necessary Data.
Most of the others contains all Object-Rows', but most Values of the Columns are missing.
With a em.clear()
inside the Loop, all tables are exported correctly but the Enity-Keys do not match.
I can't get the point - what am i doing wrong?
emf = Persistence.createEntityManagerFactory(dbFile);
em = emf.createEntityManager();
for(String tableName: tables)
{
List<Object> resultList = em.createQuery("SELECT q FROM "+tableName+" "+n).getResultList();
exportToCSV(resultList);
}
Best regards,
Harald