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!

ViewObject get attribute return always null

Emilio PetMay 8 2014 — edited May 8 2014

Hi Guys,

I need your help, I'm going crazy.

I'm just trying to iterate through  a ViewObject like I've done thousand times but despite getEstimatedRowCount return 1 and the Row object inside the WHILE is not null, getattribute return always null, doesn't care if I call getAttribute(String) or getAttribut(int)

This is the last code I'm testing:

            PeopleFinderAppModuleImpl appMod = (PeopleFinderAppModuleImpl)this.getApplicationModule();

            PfUserGetInfoImpl pf_Info = (PfUserGetInfoImpl)appMod.getPfUserGetInfo1();

            pf_Info.setp_userid(userid);

            pf_Info.executeQuery();

            System.out.println("############################################## View getEstimatedRowCount: "+pf_Info.getEstimatedRowCount());

            PfUserGetInfoRowImpl r = null;

            RowSetIterator rsIterator = pf_Info.createRowSetIterator(null); 

            while (rsIterator.hasNext()) { 

                   r = (PfUserGetInfoRowImpl)rsIterator.next(); 

                   System.out.println("############################################## AttributeCount: "+r.getAttributeCount());

                    String[] attrs = r.getAttributeNames();

                     for (int i=0 ; i < attrs.length;i++) {

                         System.out.println(i + " " + attrs[i]+"="+r.getAttributeValues()[i]);

                         }

                 } 

            rsIterator.closeRowSetIterator();

Output is:

############################################## userid: EPETRANG

############################################## View getEstimatedRowCount: 1

############################################## AttributeCount: 13

0 Userid=null

1 Name=null

2 Givenname=null

3 Surname=null

4 Title=null

5 Dn=null

6 Mail=null

7 Company=null

8 Department=null

9 Telephonenumber=null

10 Mobile=null

11 Ipphone=null

12 Manager=null

My Env specs:

Build JDEVADF_11.1.1.7.0_GENERIC_130226.1400.6493

JVM 1.6.0_45 64bit

Of course the query return 1 row in SQLDeveloper and using ApplicationModule Tester as well.

Can you see something wrong in this code? I tried to drop and recreate the ViewObject without any luck.

This post has been answered by Emilio Pet on May 8 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2014
Added on May 8 2014
16 comments
1,545 views