----- Original Message -----
Sent: Saturday, August 14, 2004 4:03
PM
Subject: [Andromda-user]
Constraints
From car rental sample...
protected java.lang.String handleCreateAdministrator(
Session sess,
java.lang.String name,
java.lang.String accountNo,
java.lang.String password)
throws AdminsException
{
try
{
Administrator admin = AdministratorFactory.create(name, accountNo,
password);
String id = (String) sess.save(admin);
return id;
}
catch (HibernateException e)
{
throw new EJBException(e);
}
}
What happens if this function is called twice with the same arguments (user
registers twice... ) ?
Where is the preferred way for andromda to handle "unique" constraints ?
Database level, in the code etc...
-- I don't think there is any "preferred way"
however I do think it would be cool to be able to enforce something like this
through OCL constraints at the middle tier level.
Also, I noticed that the car sample has no OCL for finders... Does andromda
suppor ocl in finders ? How does this work ? :)
-- Yeah only the animal quiz has a single finder in
OCL. Take a look at this page for more info: http://team.andromda.org/docs/andromda-translation-libraries/index.html
-- Also take a look at andromda-bin*(or
src)/translation-libraries/andromda-query/test/translations/query. There
are some tests in there that test the translation of OCL to EJB QL and
Hibernate QL.
Thank you,
Gabriela
Do you Yahoo!?
Yahoo!
Mail - 50x more storage than other providers!