Stupid question
447006Jul 13 2005 — edited Jul 15 2005I 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.