INSERT ... RETURNING when doing CRUD with Record objects

2019-03-29 Thread Marshall Pierce
I might be missing something obvious in the UpdatableRecord API, but I didn't find a way to emulate INSERT ... RETURNING. Is there a way to do that? As an example, I'd like to mimic this behavior (inserting into a simple table that only needs `name` specified): txnContext.insertInto(WIDGETS,

Re: copy records with primary key from one db to another

2019-03-29 Thread Christian Master
thank you so much! Am Freitag, 29. März 2019 09:09:57 UTC+1 schrieb Lukas Eder: > > > > On Fri, Mar 29, 2019 at 8:36 AM Christian Master > wrote: > >> Perfect, thank you. (to copy it from one db to another, create2 was >> missing) >> > > Yes of course. > > >> For one row i do it this way:

Re: copy records with primary key from one db to another

2019-03-29 Thread Lukas Eder
On Fri, Mar 29, 2019 at 8:36 AM Christian Master wrote: > Perfect, thank you. (to copy it from one db to another, create2 was > missing) > Yes of course. > For one row i do it this way: > MyRecord my1 = create2.selectFrom(KTO).fetchAny(); > my1.set(KTO.KTOID,null); > create1.in

Re: copy records with primary key from one db to another

2019-03-29 Thread Christian Master
Perfect, thank you. (to copy it from one db to another, create2 was missing) List> fields = new ArrayList<>(Arrays.asList(KTO.fields())); fields.removeAll(KTO.getPrimaryKey().getFields()); create1.insertInto(Tables.KTO).columns(fields).select( create2.se