Hi !

I have got a table A whith a foreign key to the Table B.
When I try to delete a record in the table B, I should normally get an error or an exception.
This is not the case : is is allowed !

Here is the source.

public void doDelete(RunData data, Context context)
throws Exception
{
intake = (IntakeTool)context.get("intake");
agenceGroup = intake.get("AgenceGroup", ProjectConstantes.AGENCE_KEY);
Integer agenceId=null;
if ( agenceGroup != null )
{
agenceId = Integer.valueOf(agenceGroup.get("AgenceId").toString());
Criteria criteria = new Criteria();
criteria.add(AgencePeer.AGENCE_ID, agenceId);
AgencePeer.doDelete(criteria);
intake.remove(agenceGroup);
setTemplate(data, "/param/AgenceList.vm");
} else {
context.put("errorTemplate", "Les données du formulaire sont inaccessibles.");
context.put("mode", "delete");
data.getParameters().add("mode", "delete");
setTemplate(data, "/param/AgenceForm.vm"); }
}


Whant is wrong ?


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to