/** * <p>Retrieve copy of entity from DB by given ID.</p> * @param pAddParam additional param * @param pId ID * @return entity or null * @throws Exception - an exception **/ @Override public final SubaccountLine retrieveCopyEntity( final Map<String, Object> pAddParam, final Object pId) throws Exception { SubaccountLine entity = getSrvOrm().retrieveCopyEntity( SubaccountLine.class, pId); entity.setIsNew(true); addTypeCodeIntoAttrs(pAddParam); addAccSettingsIntoAttrs(pAddParam); return entity; }
/** * <p>Create entity with its itsOwner e.g. invoice line * for invoice.</p> * @param pAddParam additional param * @param pEntityItsOwner itsOwner * @return entity instance * @throws Exception - an exception **/ @Override public final SubaccountLine createEntityWithOwner( final Map<String, Object> pAddParam, final Account pEntityItsOwner) throws Exception { SubaccountLine entity = new SubaccountLine(); entity.setIsNew(true); entity.setItsOwner(pEntityItsOwner); addAccSettingsIntoAttrs(pAddParam); addTypeCodeIntoAttrs(pAddParam); return entity; }
/** * <p>Create entity.</p> * @param pAddParam additional param * @return entity instance * @throws Exception - an exception **/ @Override public final SubaccountLine createEntity( final Map<String, Object> pAddParam) throws Exception { SubaccountLine entity = new SubaccountLine(); entity.setIsNew(true); Account itsOwner = new Account(); entity.setItsOwner(itsOwner); addTypeCodeIntoAttrs(pAddParam); addAccSettingsIntoAttrs(pAddParam); return entity; }
/** * <p>Create entity with its itsOwner e.g. invoice line * for invoice.</p> * @param pAddParam additional param * @param pIdEntityItsOwner entity itsOwner ID * @return entity instance * @throws Exception - an exception **/ @Override public final SubaccountLine createEntityWithOwnerById( final Map<String, Object> pAddParam, final Object pIdOwner) throws Exception { SubaccountLine entity = new SubaccountLine(); entity.setIsNew(true); Account itsOwner = getSrvOrm().retrieveEntityById( Account.class, pIdOwner); entity.setSubaccType(itsOwner.getSubaccType()); entity.setItsOwner(itsOwner); addAccSettingsIntoAttrs(pAddParam); addTypeCodeIntoAttrs(pAddParam); return entity; }