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!

Stupid question

447006Jul 13 2005 — edited Jul 15 2005
I am new to the ADF way of things. Here's what I need to do: I have a "CardId" attribute in a table. It can't be a duplicate of another CardId unless that row has a TermDate of more than 30 days ago. I have created a method in the entity called "validateCardId(String CardId)" and I have a method that is passed a row and checks if the TermDate on that row is expired (more than 30 days) or not. The problem I have is getting the correct iterator. Here is the code right now:


public boolean validateCardId(String CardId)
{
RowIterator ri = new AppModuleImpl().getLpEmpsView1();
ri.first();
boolean valid = false;
while(ri.hasNext())
{
if(this.getCardId().equals(((LpEmpsImpl)ri.next()).getCardId()))
{
if(expiredTermDate(this))
{
valid = true;
}
else
{
valid = false;
}
}
else
{
valid = true;
}
}
return valid;
}

Please excuse the bad formatting; I'm not sure how to tell the forum to display it.

It returns false on every CardId entry unless it is the original value. I commented all references to iterators and rows out and just had it return true every time and it worked fine. As soon as I put in the iterator declaration it returned false every time. I know I'm probably doing something incredibly stupid, but since I'm new to ADF and databases in general, any help would be appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 12 2005
Added on Jul 13 2005
13 comments
347 views