{
String className = mappingClass.getName();
if (stream != null)
{
XMLOutputStream xmlOutput = new XMLOutputStream(stream);
try
{
mappingClass.preArchive(); // call pre archive hook
xmlOutput.writeObject(mappingClass);
// update modified flags for the mapping and persistence
// classes after save
mappingClass.setModified(false);
getPersistenceClass(mappingClass).setModified(false);
}
catch (ModelException e)
{
// MBO: print reason to logger
LogHelperModel.getLogger().log(Logger.WARNING,
e.getMessage());
}
finally
{
if (xmlOutput != null)
xmlOutput.close();
unlockFile(stream, className);
}
return;
}