public ItemEnclosureIF createItemEnclosure(ItemIF item, URL location,
String type, int length) {
Query query = session.createQuery("from ItemEnclosure as enc where enc.item.id = ? ");
query.setLong(0, item.getId());
ItemEnclosureIF obj = (ItemEnclosureIF) query.uniqueResult();
if (obj == null) {
obj = new ItemEnclosure(item, location, type, length);
session.save(obj);
}
return obj;