Re: java.lang.ClassCastException
Re: java.lang.ClassCastException
- Subject: Re: java.lang.ClassCastException
- From: WebObjects <email@hidden>
- Date: Mon, 29 Sep 2008 13:03:32 -0500
Nop, unfortunately it didn't work. I did it before, and did it again
and it didn't want to work. Im fetching the right Employee,, becuase
its the only one I have in the db
:s.
Any ideas
Gustavo
On Sep 29, 2008, at 12:37 PM, Jaime Magiera wrote:
On Sep 29, 2008, at 12:06 PM, WebObjects wrote:
Application:
ControlHorarios
Error:
java.lang.ClassCastException:
com.webobjects.eocontrol.EOGenericRecord
Reason:
com.webobjects.eocontrol.EOGenericRecord
I have this in the code:
try {
EOQualifier qual =
Empleado.E_MAIL.eq(email).and(Empleado.PASSWORD.eq(password));
emp =
Empleado.fetchRequiredEmpleado(session().defaultEditingContext(),
qual);
System.out.println(emp.nombre()+" y con pass "+emp.password());
this.errorMessage = "Success";
} catch (NoSuchElementException e) {
this.errorMessage ="EMail o Contrase–a Erroneos";
}catch (Exception e){
//TODO
System.out.println(emp.nombre()+" y con pass "+emp.password());
}
Hi,
If you enter invalid search information, you won't be pulling an
object up. However, if you do pull a valid object up via EOQualifer
fetch, it's going to be of type EOGenericRecord. You have to coerce
it to the proper object type. Example...
Employee emp;
emp =
(Employee
)Empleado.fetchRequiredEmpleado(session().defaultEditingContext(),
qual);
hope that helps,
Jaime Magiera
Sensory Research
http://www.sensoryresearch.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden