I am in the middle of removing the "named parameter" feature of DAS
command and notice that we currently allow a special convenience name to
allow a client to retrieve a database generated ID from a low-level
insert command like this:
DAS das = DAS.FACTORY.createDAS(getConnection());
Command insert = das.createCommand("insert into COMPANY (NAME)
values (?)");
insert.setParameter(1, "AAA Rental");
insert.execute();
Integer key = (Integer) insert.getParameter("generated_key");
I expect that clients will typically not execute a low level insert like
this. Instead, I expect them to pass a modified graph to the DAS and
the DAS will generate and execute a set of insert statements. Any
database-generated IDs will be propagated back to the provided data
graph and the client can access them there.
That said, I think this is a nice low-level feature so I hate to get rid
of it. But, I am removing named parameter access. I suppose I could
provide a special convenience parameter index to serve the same
purpose. Something like:
Integer key = (Integer) insert.getParameter(DAS.GENERATED_KEY);
That would work but seems a bit cheesy ... maybe no cheesier than the
special name. Any other ideas?
Thanks,
--Kevin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]