On Wed, Apr 28, 2004 at 10:58:11PM -0400, graham king wrote: > I'm as green as they get when it comes to using the various > descriptor files and mapping techniques, but, I've managed to get > the CMP example to run against mySQL. I've watched it several times > and I still cannot figure out, even googled myself crazy, how the > CMP works?
The basics are that upon method access or around transactional boundaries, the container will take the data out of the bean instance's persistent variables via reflection and put them into the database. The key here being 'persitent' variables. You need to configure in your mapping file which variables (aka fields) you want to be persisted. > I see that it's incrementing the employee.id each time I execute, > but, the values aren't being stored in the db. I modified the > EmployeeBean to explicitly call the database which successfully > inserted the record, but, doesn't that go against using the > container for data managed persistence? Check your mapping.xml file and make sure your 'persistent' variables are marked as public. Again, if you get anything working, you are encouraged to help with the documentation effort via the wiki. -David
