return findDbModelItem(pc, item.getModel().getName(), item.getName(), item.getItemType());
}
private DbModelItem findDbModelItem(PersistenceContext pc, String modelName, String itemName, String itemType)
{
PersistenceQuery query = pc.createQuery(DbModelItem.class);
query.eq("modelName", modelName);
query.eq("itemName", itemName);
query.eq("itemType", itemType);
Iterator it = pc.runQuery(query);
if (! it.hasNext())
throw new ModelException("DatabaseOperation", "Component '" + new ModelQualifier(modelName, itemName, itemType).toUntypedString()
+ "' not found. Maybe the component has been deleted from the database.");
DbModelItem dbModelItem = (DbModelItem) it.next();