EventType eventTypeObject = (EventType) databaseSession.createCriteria(EventType.class).add(Restrictions.eq("id", this.eventType)).uniqueResult();
if(null == eventTypeObject) {
return new Response(ResponseStatus.FAIL, "Not valid event type");
}
EventId eventIdObject = new EventId();
eventIdObject.setFrom(fromDate);
eventIdObject.setTo(toDate);
eventIdObject.setOwner(userObject);
eventIdObject.setType(eventTypeObject);
PermissionType permisssionTypeObject = (PermissionType) databaseSession.createCriteria(PermissionType.class).add(Restrictions.eq("id", this.permissionType)).uniqueResult();
if(null == permisssionTypeObject) {
return new Response(ResponseStatus.FAIL, "Not valid permisssion type");
}