Criteria criteria = TurbineUserPeer.buildCriteria(user);
try
{
// perform the insert to the database
ObjectKey pk = TurbineUserPeer.doInsert(criteria);
// update the user object with the primary key
TurbineMapBuilder mapbuilder = (TurbineMapBuilder)
TurbineUserPeer.getMapBuilder("org.apache.turbine.util.db.map.TurbineMapBuilder");
user.setPerm(mapbuilder.getUserId(), pk);