}
public ItemGuidIF createItemGuid(ItemIF item, String location, boolean permaLink) {
Query query = session.createQuery("from ItemGuid as guid where guid.location = ? ");
query.setString(0, location);
ItemGuidIF guid = (ItemGuidIF) query.uniqueResult();
if (guid == null) {
guid = new ItemGuid(item, location, permaLink);
guid.setPermaLink(permaLink);
session.save(guid);
}
return guid;
}