/** * save */ public ims.core.vo.MskJointVo save(ims.core.vo.MskJointVo voMskJoint) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException { if(voMskJoint == null) throw new DomainRuntimeException("Invalid MskJoint record to save"); if(!voMskJoint.isValidated()) throw new DomainRuntimeException("MskJoint record not validated"); DomainFactory factory = getDomainFactory(); MskJoints domJoint = MskJointVoAssembler.extractMskJoints(factory, voMskJoint); try { factory.save(domJoint); } catch(UnqViolationUncheckedException e) { String strMsg = "A joint with the name '" + voMskJoint.getName() + "' already exists within the system."; throw new UniqueKeyViolationException(strMsg, e); } return MskJointVoAssembler.create(domJoint); }
public MskJointVoCollection listJointsForGroupType(MSKGroupType groupType) { DomainFactory factory = getDomainFactory(); String hql = " select joints from MskGroups m "; StringBuffer condStr = new StringBuffer(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); condStr.append(" where m.groupType = :groupType"); markers.add("groupType"); values.add(getDomLookup(groupType)); hql += condStr.toString(); return MskJointVoAssembler.createMskJointVoCollectionFromMskJoints(factory.find(hql, markers, values)).sort(); }
public MskJointVoCollection listJointWithGroupTypeDigit(Boolean isDigitType) { DomainFactory factory = getDomainFactory(); String strSQL = new String(); StringBuffer condStr = new StringBuffer(); String andStr = " "; strSQL = "select m2_1 from MskGroups as m1_1 left join m1_1.groupType as l1_1 join m1_1.joints as m2_1 where m1_1.isActive = 1"; if (isDigitType.equals(Boolean.TRUE)) { andStr = " and "; condStr.append(andStr + "m1_1.groupType.id = -855"); } strSQL += condStr.toString(); return ims.core.vo.domain.MskJointVoAssembler.createMskJointVoCollectionFromMskJoints(factory.find(strSQL)); }
/** * list */ public ims.core.vo.MskJointVoCollection list(Boolean boolActive) { DomainFactory factory = getDomainFactory(); String strSQL = new String(); if (boolActive.equals(Boolean.TRUE)) strSQL = "from MskJoints m where m.isActive = "+ boolActive; else strSQL = "from MskJoints "; return ims.core.vo.domain.MskJointVoAssembler.createMskJointVoCollectionFromMskJoints(factory.find(strSQL)); }
public RangeOfMovementJointVoCollection listJoints() { DomainFactory factory = getDomainFactory(); String hql; hql = " from MskGroups m where m.isActive = true and m.isJoint = true"; List lstGroups = factory.find(hql); RangeOfMovementJointVoCollection voCollJoints = new RangeOfMovementJointVoCollection(); for (Iterator iter = lstGroups.iterator(); iter.hasNext();) { MskGroups domGroup = (MskGroups) iter.next(); if (domGroup.isIsJoint().equals(Boolean.TRUE) && domGroup.isIsJoint().equals(Boolean.TRUE)) { MskGroupLiteVo voGroup = MskGroupLiteVoAssembler.create(domGroup); for (Iterator iterator = domGroup.getJoints().iterator(); iterator.hasNext();) { RangeOfMovementJointVo voJoint = new RangeOfMovementJointVo(); MskJoints domJoint = (MskJoints) iterator.next(); voJoint.setJoint(MskJointVoAssembler.create(domJoint)); voJoint.setGroup(voGroup); voCollJoints.add(voJoint); } } } return voCollJoints; }
public MskJointsMovementsCollection listMovementsForJoint(MskJointsRefVo refJoint) { // WDEV-4490 - Check for nulls if (refJoint == null || !refJoint.getID_MskJointsIsNotNull()) return null; DomainFactory factory = getDomainFactory(); MskJoints domJoint = (MskJoints) factory.getDomainObject(MskJoints.class, refJoint.getID_MskJoints()); MskJointVo voJoint = MskJointVoAssembler.create(domJoint); return voJoint.getMovements(); }
public MskJointVoCollection listJoints(String strName) { DomainFactory factory = getDomainFactory(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String hql; hql = " from MskJoints m where m.isActive = true and upper(m.name) like :Name"; markers.add("Name"); values.add(strName.toUpperCase() + "%"); List lstJoints = factory.find(hql, markers, values); return MskJointVoAssembler.createMskJointVoCollectionFromMskJoints(lstJoints); }
public MskJointVoCollection listJointsForGroup(MskGroupsRefVo voRefMskGroup) { // WDEV-4490 - Check for null parameter if (voRefMskGroup == null || !voRefMskGroup.getID_MskGroupsIsNotNull()) return null; DomainFactory factory = getDomainFactory(); String hql = " select m.joints from MskGroups m where m.isActive = true and m.id = " + voRefMskGroup.getID_MskGroups(); return MskJointVoAssembler.createMskJointVoCollectionFromMskJoints(factory.find(hql)).sort(); }
public MskJointVo get(MskJointsRefVo voMskJoint) { DomainFactory factory = getDomainFactory(); MskJoints domJoints = (MskJoints) factory.getDomainObject(MskJoints.class, voMskJoint.getID_MskJoints()); return MskJointVoAssembler.create(domJoints); }