Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Null Value Handle In Adf

3469097Nov 2 2017 — edited Nov 3 2017

Hi All,

Am using JDeveloper 12.2.1.0  version,

I Have a requirement to do i.e,

I Have written code in EOImpl like below

        if (operation == AR_CUSTOMERS_M_EOImpl.DML_UPDATE) {                 

      try {

                if (this.getCustomerType().equals("P")) {

                    System.out.println("first_Name is :" + this.getFirstName());

                    System.out.println("middle_Name is :" +this.getMiddleName());

                    System.out.println("last_Name is :" + this.getLastName());

                    String Cust_Name = this.getFirstName().concat(" ").concat(this.getMiddleName().concat(" ").concat(this.getLastName()));

                    this.setCustomerName(Cust_Name);

                    System.out.println("Cust_Name is :" + this.getCustomerName());

                }

            } catch (Exception e1) {

                // TODO: Add catch code

                e1.printStackTrace();

            }

String Cust_Name = this.getFirstName().concat(" ").concat(this.getMiddleName().concat(" ").concat(this.getLastName()));

                    this.setCustomerName(Cust_Name);

1) setCustomerName is not null column (CustomerName is a NotNull Column in Database table means mandatory)

2) while entering CustomerName on screen if it is null the we need to pass (first_name||' '||middle||' '||last_name)( Like Above am getting successfully this scenario)

3) Now when user enter First Name and not entered   middle_name, last_name i want store first name only

5) while testing 4 point scenario am getting null pointer exception and CustomerName not storing in database

because i am not entered middle_name and last_name( those are not a notnull columns in  database means not mandatory)

Final:can anyone help me on  above issue.

This post has been answered by Timo Hahn on Nov 2 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 1 2017
Added on Nov 2 2017
2 comments
419 views