I'm trying to write a single page app which will persist the current users into a database table(HSQL) and also a list of "stories"(just 1 liners) into a separate table (in same DB)
I have 2 POJOs, User and Story. Then 2 dtos, 2 repositories etc but am struggling to figure out how to persist these to 2 tables...
Basically I need to know whether I need 2 persistence-units and 2 entityManagerFactory's , even though I wish to write to a single database, but to 2 tables...as seems to be the case from looking around but part of the problem is that I am very confused with some of the lingo.
There are many questions regarding multiple tables, but they always seem to be in different data sources. In this context are data sources simply tables? Ie persisting to same database but different tables (aka data sources) If not, are "datasource" and "database" interchangeable in this context?
Thanks.