@Test public void test1MapViewToEntityBean() { RangerServiceDef rangerServiceDef = rangerServiceDef(); XXServiceDef serviceDef = serviceDef(); int operationContext = 1; XXServiceDef dbServiceDef = rangerServiceDefService .mapViewToEntityBean(rangerServiceDef, serviceDef, operationContext); Assert.assertNotNull(dbServiceDef); Assert.assertEquals(dbServiceDef, serviceDef); Assert.assertEquals(dbServiceDef.getDescription(), serviceDef.getDescription()); Assert.assertEquals(dbServiceDef.getGuid(), serviceDef.getGuid()); Assert.assertEquals(dbServiceDef.getName(), serviceDef.getName()); Assert.assertEquals(dbServiceDef.getAddedByUserId(), serviceDef.getAddedByUserId()); Assert.assertEquals(dbServiceDef.getId(), serviceDef.getId()); Assert.assertEquals(dbServiceDef.getVersion(), serviceDef.getVersion()); Assert.assertEquals(dbServiceDef.getImplclassname(), serviceDef.getImplclassname()); Assert.assertEquals(dbServiceDef.getUpdatedByUserId(), serviceDef.getUpdatedByUserId()); }
@Override protected T mapViewToEntityBean(V vObj, T xObj, int operationContext) { String guid = (StringUtils.isEmpty(vObj.getGuid())) ? guidUtil.genGUID() : vObj.getGuid(); xObj.setGuid(guid); xObj.setName(vObj.getName()); xObj.setDisplayName(vObj.getDisplayName()); xObj.setImplclassname(vObj.getImplClass()); xObj.setLabel(vObj.getLabel()); xObj.setDescription(vObj.getDescription()); xObj.setRbkeylabel(vObj.getRbKeyLabel()); xObj.setRbkeydescription(vObj.getRbKeyDescription()); xObj.setIsEnabled(vObj.getIsEnabled()); xObj.setDefOptions(mapToJsonString(vObj.getOptions())); return xObj; }
RangerServiceDefServiceBase extends RangerBaseModelService<T, V> { @Override protected T mapViewToEntityBean(V vObj, T xObj, int operationContext) { String guid = (StringUtils.isEmpty(vObj.getGuid())) ? guidUtil.genGUID() : vObj.getGuid(); xObj.setGuid(guid); xObj.setName(vObj.getName()); xObj.setDisplayName(vObj.getDisplayName()); xObj.setImplclassname(vObj.getImplClass()); xObj.setLabel(vObj.getLabel()); xObj.setDescription(vObj.getDescription()); xObj.setRbkeylabel(vObj.getRbKeyLabel()); xObj.setRbkeydescription(vObj.getRbKeyDescription()); xObj.setIsEnabled(vObj.getIsEnabled()); xObj.setDefOptions(mapToJsonString(vObj.getOptions())); return xObj; } }
RangerServiceDefServiceBase extends RangerBaseModelService<T, V> { @Override protected T mapViewToEntityBean(V vObj, T xObj, int operationContext) { String guid = (StringUtils.isEmpty(vObj.getGuid())) ? guidUtil.genGUID() : vObj.getGuid(); xObj.setGuid(guid); xObj.setName(vObj.getName()); xObj.setDisplayName(vObj.getDisplayName()); xObj.setImplclassname(vObj.getImplClass()); xObj.setLabel(vObj.getLabel()); xObj.setDescription(vObj.getDescription()); xObj.setRbkeylabel(vObj.getRbKeyLabel()); xObj.setRbkeydescription(vObj.getRbKeyDescription()); xObj.setIsEnabled(vObj.getIsEnabled()); xObj.setDefOptions(mapToJsonString(vObj.getOptions())); return xObj; } RangerServiceDefServiceBase(); }
RangerServiceDefServiceBase extends RangerBaseModelService<T, V> { @Override protected T mapViewToEntityBean(V vObj, T xObj, int operationContext) { String guid = (StringUtils.isEmpty(vObj.getGuid())) ? guidUtil.genGUID() : vObj.getGuid(); xObj.setGuid(guid); xObj.setName(vObj.getName()); xObj.setDisplayName(vObj.getDisplayName()); xObj.setImplclassname(vObj.getImplClass()); xObj.setLabel(vObj.getLabel()); xObj.setDescription(vObj.getDescription()); xObj.setRbkeylabel(vObj.getRbKeyLabel()); xObj.setRbkeydescription(vObj.getRbKeyDescription()); xObj.setIsEnabled(vObj.getIsEnabled()); xObj.setDefOptions(mapToJsonString(vObj.getOptions())); return xObj; } RangerServiceDefServiceBase(); XXServiceConfigDef populateRangerServiceConfigDefToXX(RangerServiceConfigDef vObj, XXServiceConfigDef xObj,
			XXServiceDef serviceDef, int operationContext); RangerServiceConfigDef populateXXToRangerServiceConfigDef(XXServiceConfigDef xObj); XXResourceDef populateRangerResourceDefToXX(RangerResourceDef vObj, XXResourceDef xObj,
			XXServiceDef serviceDef, int operationContext); RangerResourceDef populateXXToRangerResourceDef(XXResourceDef xObj); XXAccessTypeDef populateRangerAccessTypeDefToXX(RangerAccessTypeDef vObj, XXAccessTypeDef xObj,
			XXServiceDef serviceDef, int operationContext); RangerAccessTypeDef populateXXToRangerAccessTypeDef(XXAccessTypeDef xObj); XXPolicyConditionDef populateRangerPolicyConditionDefToXX(RangerPolicyConditionDef vObj,
			XXPolicyConditionDef xObj, XXServiceDef serviceDef, int operationContext); RangerPolicyConditionDef populateXXToRangerPolicyConditionDef(XXPolicyConditionDef xObj); XXContextEnricherDef populateRangerContextEnricherDefToXX(RangerContextEnricherDef vObj,
			XXContextEnricherDef xObj, XXServiceDef serviceDef, int operationContext); RangerContextEnricherDef populateXXToRangerContextEnricherDef(XXContextEnricherDef xObj); XXEnumDef populateRangerEnumDefToXX(RangerEnumDef vObj, XXEnumDef xObj, XXServiceDef serviceDef,
			int operationContext); RangerEnumDef populateXXToRangerEnumDef(XXEnumDef xObj); XXEnumElementDef populateRangerEnumElementDefToXX(RangerEnumElementDef vObj, XXEnumElementDef xObj,
			XXEnumDef enumDef, int operationContext); RangerEnumElementDef populateXXToRangerEnumElementDef(XXEnumElementDef xObj); XXDataMaskTypeDef populateRangerDataMaskDefToXX(RangerDataMaskTypeDef vObj, XXDataMaskTypeDef xObj,
														   XXServiceDef serviceDef, int operationContext); RangerDataMaskTypeDef populateXXToRangerDataMaskTypeDef(XXDataMaskTypeDef xObj); RangerServiceDefList searchRangerServiceDefs(SearchFilter searchFilter); String objectToJson(Serializable obj); DST jsonToObject(String jsonStr, Class<DST> clz); }
RangerServiceDefServiceBase extends RangerBaseModelService<T, V> { @Override protected T mapViewToEntityBean(V vObj, T xObj, int operationContext) { String guid = (StringUtils.isEmpty(vObj.getGuid())) ? guidUtil.genGUID() : vObj.getGuid(); xObj.setGuid(guid); xObj.setName(vObj.getName()); xObj.setDisplayName(vObj.getDisplayName()); xObj.setImplclassname(vObj.getImplClass()); xObj.setLabel(vObj.getLabel()); xObj.setDescription(vObj.getDescription()); xObj.setRbkeylabel(vObj.getRbKeyLabel()); xObj.setRbkeydescription(vObj.getRbKeyDescription()); xObj.setIsEnabled(vObj.getIsEnabled()); xObj.setDefOptions(mapToJsonString(vObj.getOptions())); return xObj; } RangerServiceDefServiceBase(); XXServiceConfigDef populateRangerServiceConfigDefToXX(RangerServiceConfigDef vObj, XXServiceConfigDef xObj,
			XXServiceDef serviceDef, int operationContext); RangerServiceConfigDef populateXXToRangerServiceConfigDef(XXServiceConfigDef xObj); XXResourceDef populateRangerResourceDefToXX(RangerResourceDef vObj, XXResourceDef xObj,
			XXServiceDef serviceDef, int operationContext); RangerResourceDef populateXXToRangerResourceDef(XXResourceDef xObj); XXAccessTypeDef populateRangerAccessTypeDefToXX(RangerAccessTypeDef vObj, XXAccessTypeDef xObj,
			XXServiceDef serviceDef, int operationContext); RangerAccessTypeDef populateXXToRangerAccessTypeDef(XXAccessTypeDef xObj); XXPolicyConditionDef populateRangerPolicyConditionDefToXX(RangerPolicyConditionDef vObj,
			XXPolicyConditionDef xObj, XXServiceDef serviceDef, int operationContext); RangerPolicyConditionDef populateXXToRangerPolicyConditionDef(XXPolicyConditionDef xObj); XXContextEnricherDef populateRangerContextEnricherDefToXX(RangerContextEnricherDef vObj,
			XXContextEnricherDef xObj, XXServiceDef serviceDef, int operationContext); RangerContextEnricherDef populateXXToRangerContextEnricherDef(XXContextEnricherDef xObj); XXEnumDef populateRangerEnumDefToXX(RangerEnumDef vObj, XXEnumDef xObj, XXServiceDef serviceDef,
			int operationContext); RangerEnumDef populateXXToRangerEnumDef(XXEnumDef xObj); XXEnumElementDef populateRangerEnumElementDefToXX(RangerEnumElementDef vObj, XXEnumElementDef xObj,
			XXEnumDef enumDef, int operationContext); RangerEnumElementDef populateXXToRangerEnumElementDef(XXEnumElementDef xObj); XXDataMaskTypeDef populateRangerDataMaskDefToXX(RangerDataMaskTypeDef vObj, XXDataMaskTypeDef xObj,
														   XXServiceDef serviceDef, int operationContext); RangerDataMaskTypeDef populateXXToRangerDataMaskTypeDef(XXDataMaskTypeDef xObj); RangerServiceDefList searchRangerServiceDefs(SearchFilter searchFilter); String objectToJson(Serializable obj); DST jsonToObject(String jsonStr, Class<DST> clz);  }