How to add/modify database records using Cayenne API -


i seeking use apache cayenne implement database, , know how use cayenne's api perform "add" operation.

i have been reading on query document 2 days. gives information on how list of objects in table, how search primary key, how use expressions modify searches, , many different ways can search database.

it not tell how add new record table, or how make changes record. doco writers seem interested in documenting nice searches can do.

can please either provide or point me example of doing adds , updates??? example of delete nice, too...

someone please advise.

adding , deleting "data" in cayenne done via objectcontext operations on corresponding "objects". examples available in tutorial here , here , in the main docs, here quick explanation:

// create new object in memory artist = context.newobject(artist.class);  // save db. generate insert sql context.commitchanges();  // delete object in memory context.deleteobjects(a);  // save db too. generate delete sql context.commitchanges(); 

and recommend go through tutorial. shows main pieces of cayenne without giving many distracting details.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -