Commit 5e54d0f4 authored by smestry's avatar smestry

Update class file for checknull and trim method


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@102913 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ab76ebe0
...@@ -291,7 +291,7 @@ public class ItmAttribValIC extends ValidatorEJB implements ItmAttribValICRemote ...@@ -291,7 +291,7 @@ public class ItmAttribValIC extends ValidatorEJB implements ItmAttribValICRemote
//Changed and Commented By Santosh on 14-06-2016 :[END] //Changed and Commented By Santosh on 14-06-2016 :[END]
userId = getValueFromXTRA_PARAMS(xtraParams,"loginCode"); userId = getValueFromXTRA_PARAMS(xtraParams,"loginCode");
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
descr = checkNull(genericUtility.getColumnValue("descr", dom)); descr = checkNull(genericUtility.getColumnValue("descr", dom)); // Sneha
//Changed by Jagruti on 24/12/2015 for short descr[Start]. //Changed by Jagruti on 24/12/2015 for short descr[Start].
shortDescr = checkNull(genericUtility.getColumnValue("sh_descr", dom)); shortDescr = checkNull(genericUtility.getColumnValue("sh_descr", dom));
//Changed by Jagruti on 24/12/2015 for short descr[End]. //Changed by Jagruti on 24/12/2015 for short descr[End].
...@@ -324,7 +324,10 @@ public class ItmAttribValIC extends ValidatorEJB implements ItmAttribValICRemote ...@@ -324,7 +324,10 @@ public class ItmAttribValIC extends ValidatorEJB implements ItmAttribValICRemote
} }
else else
{ {
String itemCode = checkNull(genericUtility.getColumnValue("attrib_code", dom)); //String itemCode = checkNull(genericUtility.getColumnValue("attrib_code", dom));
String itemCode = checkNullAndTrim(genericUtility.getColumnValue("attrib_code", dom)); // Changed by Sneha on 09-08-2016
//System.out.println("itemCode===>>["+itemCode+"]");
query =" SELECT count(1) FROM item_attribute WHERE attrib_code=? " ; query =" SELECT count(1) FROM item_attribute WHERE attrib_code=? " ;
pstmt = conn.prepareStatement(query); pstmt = conn.prepareStatement(query);
pstmt.setString(1, itemCode); pstmt.setString(1, itemCode);
...@@ -352,9 +355,14 @@ public class ItmAttribValIC extends ValidatorEJB implements ItmAttribValICRemote ...@@ -352,9 +355,14 @@ public class ItmAttribValIC extends ValidatorEJB implements ItmAttribValICRemote
} }
else else
{ {
attribCode = checkNull(genericUtility.getColumnValue("attrib_code", dom)); // Changed by Sneha on 09-08-2016, to trim the value [Start]
attribId = checkNull(genericUtility.getColumnValue("attrib_id", dom)); //attribCode = checkNull(genericUtility.getColumnValue("attrib_code", dom));
//attribId = checkNull(genericUtility.getColumnValue("attrib_id", dom));
attribCode = checkNullAndTrim(genericUtility.getColumnValue("attrib_code", dom));
attribId = checkNullAndTrim(genericUtility.getColumnValue("attrib_id", dom));
//System.out.println("attribCode inside attrib_id ===>["+attribCode+"] attribId===>>"+attribId+"]");
// Changed by Sneha on 09-08-2016, to trim the value [End]
query = "select attrib_id from itm_attrib_val where attrib_id = ? and attrib_code='SIZE_TYPE' "; query = "select attrib_id from itm_attrib_val where attrib_id = ? and attrib_code='SIZE_TYPE' ";
pstmt= conn.prepareStatement(query); pstmt= conn.prepareStatement(query);
pstmt.setString(1, attribCode); pstmt.setString(1, attribCode);
...@@ -419,10 +427,15 @@ public class ItmAttribValIC extends ValidatorEJB implements ItmAttribValICRemote ...@@ -419,10 +427,15 @@ public class ItmAttribValIC extends ValidatorEJB implements ItmAttribValICRemote
} }
break; break;
} }
attribCode = checkNull(genericUtility.getColumnValue("attrib_code", dom));
attribId = checkNull(genericUtility.getColumnValue("attrib_id", dom)); // Changed by Sneha on 09-08-2016, to trim the value [Start]
//attribCode = checkNull(genericUtility.getColumnValue("attrib_code", dom));
//attribId = checkNull(genericUtility.getColumnValue("attrib_id", dom));
attribCode = checkNullAndTrim(genericUtility.getColumnValue("attrib_code", dom));
attribId = checkNullAndTrim(genericUtility.getColumnValue("attrib_id", dom));
//System.out.println("attribCode outside ===>["+attribCode+"] attribId===>>"+attribId+"]");
// Changed by Sneha on 09-08-2016, to trim the value [End]
if(editFlag.equalsIgnoreCase("A")) if(editFlag.equalsIgnoreCase("A"))
{ {
query =" SELECT count(1) FROM itm_attrib_val WHERE attrib_code=? and attrib_id=? " ; query =" SELECT count(1) FROM itm_attrib_val WHERE attrib_code=? and attrib_id=? " ;
...@@ -581,5 +594,20 @@ public class ItmAttribValIC extends ValidatorEJB implements ItmAttribValICRemote ...@@ -581,5 +594,20 @@ public class ItmAttribValIC extends ValidatorEJB implements ItmAttribValICRemote
return null; return null;
} }
// Changed by Sneha on 09-08-2016 [Start]
private String checkNullAndTrim( String inputVal )
{
if ( inputVal == null )
{
inputVal = "";
}
else
{
inputVal = inputVal.trim();
}
return inputVal;
}
// Changed by Sneha on 09-08-2016 [End]
} }
...@@ -149,9 +149,16 @@ public class ObjAttributeIC extends ValidatorEJB implements ObjAttributeICLocal, ...@@ -149,9 +149,16 @@ public class ObjAttributeIC extends ValidatorEJB implements ObjAttributeICLocal,
}//END SWITCH }//END SWITCH
if(!"E".equalsIgnoreCase(editFlag)) if(!"E".equalsIgnoreCase(editFlag))
{ {
objCode = checkNull(genericUtility.getColumnValue("obj_name", dom)); // Changed by Sneha on 09-08-2016, for trim [Start]
/*objCode = checkNull(genericUtility.getColumnValue("obj_name", dom));
itemVal = checkNull(genericUtility.getColumnValue("item_attr_val", dom)); itemVal = checkNull(genericUtility.getColumnValue("item_attr_val", dom));
languageVal = checkNull(genericUtility.getColumnValue("languages", dom)); languageVal = checkNull(genericUtility.getColumnValue("languages", dom));*/
objCode = checkNullAndTrim(genericUtility.getColumnValue("obj_name", dom));
itemVal = checkNullAndTrim(genericUtility.getColumnValue("item_attr_val", dom));
languageVal = checkNullAndTrim(genericUtility.getColumnValue("languages", dom));
//System.out.println("objCode==>>["+objCode+"] itemVal===>>["+itemVal+"] languageVal===>>["+languageVal+"]");
// Changed by Sneha on 09-08-2016, for trim [End]
sql =" SELECT count(1) FROM OBJ_ATTRIBUTE WHERE obj_name=? AND item_attr_val=? AND languages=?" ; sql =" SELECT count(1) FROM OBJ_ATTRIBUTE WHERE obj_name=? AND item_attr_val=? AND languages=?" ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, objCode); pstmt.setString(1, objCode);
...@@ -204,4 +211,19 @@ public class ObjAttributeIC extends ValidatorEJB implements ObjAttributeICLocal, ...@@ -204,4 +211,19 @@ public class ObjAttributeIC extends ValidatorEJB implements ObjAttributeICLocal,
} }
return input; return input;
} }
// Changed by Sneha on 09-08-2016 [Start]
private String checkNullAndTrim( String inputVal )
{
if ( inputVal == null )
{
inputVal = "";
}
else
{
inputVal = inputVal.trim();
}
return inputVal;
}
// Changed by Sneha on 09-08-2016 [End]
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment