/** * Stores the object in the database. If the object is new, it inserts it; otherwise an update is * performed. This method is meant to be used as part of a transaction, otherwise use the save() * method and the connection details will be handled internally * * @param con * @throws TorqueException */ public void save(Connection con) throws TorqueException { if (!alreadyInSave) { alreadyInSave = true; // If this object has been modified, then save it to the database. if (isModified()) { if (isNew()) { LocationPeer.doInsert((Location) this, con); setNew(false); } else { LocationPeer.doUpdate((Location) this, con); } } if (collDorderItems != null) { for (int i = 0; i < collDorderItems.size(); i++) { ((DorderItem) collDorderItems.get(i)).save(con); } } alreadyInSave = false; } }
/** * Stores the object in the database. If the object is new, it inserts it; otherwise an update is * performed. * * @throws Exception */ public void save() throws Exception { save(LocationPeer.getMapBuilder().getDatabaseMap().getName()); }