Hi,
I'm trying to do a method with an OCL that returns an object.
The OCL assigned to the method is the following:
context Personas::findByFechaEdadYDNI(fecha:Date,edad:Integer,dni:String):Personas body : allInstances()-> select ( persona | persona.fnacimiento <= fecha and (persona.ffallecimiento > fecha or persona.ffallecimiento = null) and persona.edad = edad) and persona.dni = dni


I know that this select is going to return just one instance... so I don't want a collection of objects with one object, I just want the object.

The method (in the diagram) that holds this constraint returns the correct type and receives the corrects parameters (also their types).
I'm getting two problems.
First, the signature of the result method returns the correct type Personas, but the implementation still doing return query.list();
This causes a compilation error of the generated source because of the types diference between the method signature and the returned type of list method.


Second, the *= null* clause is translated as is. I'm using PostgreSQL and this sentence doesn't work. I need *= null* to be translated into *is null*

How can I solve these? What am I missing?

Thanks in advance
Bruno



-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
Andromda-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to