[jboss-user] [JBoss Cache: Core Edition] - I want to insert data after i attach an object in pojo cache
anupamajboss
do-not-reply at jboss.com
Fri Oct 24 07:17:07 EDT 2008
anonymous wrote :
|
| I am attaching an Object
|
| Set stateSet = new HashSet();
|
| // STATE ONE
| stateOne = new State();
| stateOne.setStateName("KARNATAKA");
| stateOne.setStateId(new Long(1));
|
| // STATE TWO
| stateTwo = new State();
| stateTwo.setStateName("UP");
| stateTwo.setStateId(new Long(2));
|
| // ADD STATES TO A SET
| stateSet.add(stateOne);
| stateSet.add(stateTwo);
|
| // ADD A COUNTRY
| Country country = new Country();
| country.setCountryId(new Long(1));
| country.setCountryName("INDIA");
|
| stateOne.setCountry(country); // set the country reference
| stateTwo.setCountry(country); // set the country reference
|
| cache.attach("/pojo1", stateOne);
|
| I now want to persist this to Database....Please help me with some code to carry on.
| Is it necessary to create a JDBCCacheLoader to load STATE ?
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184445#4184445
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184445
More information about the jboss-user
mailing list