}
public void testPartialFKToPKMapping()
throws Exception
{
StudentLocal petrovStudent = null;
StudentLocal sidorovStudent = null;
GroupLocal group = null;
try {
petrovStudent = getStudentHome().create("KV", "Petrov", "Petrov works on KV department.");
group = getGroupHome().create("KV", 62, "KV-62");
assertTrue("petrovStudent.getGroup() == null", petrovStudent.getGroup() == null);
petrovStudent.setGroup(group);
assertTrue("group.isIdentical(petrovStudent.getGroup())", group.isIdentical(petrovStudent.getGroup()));
assertTrue("group.getStudents().contains(petrovStudent)", group.getStudents().contains(petrovStudent));
sidorovStudent = getStudentHome().create("KV", "Sidorov", "Sidorov works on KV department.");
group.getStudents().add(sidorovStudent);
assertTrue("sidorovStudent.getGroup().isIdentical(group)", sidorovStudent.getGroup().isIdentical(group));
assertTrue("group.getStudents().contains(petrovStudent)", group.getStudents().contains(petrovStudent));
assertTrue("group.getStudents().contains(sidorovStudent)", group.getStudents().contains(sidorovStudent));
group.remove();
group = null;
assertTrue("petrovStudent.getGroup() == null", petrovStudent.getGroup() == null);
assertTrue("sidorovStudent.getGroup() == null", sidorovStudent.getGroup() == null);
/*
group = getGroupHome().create("KV", 62, "KV-62");
assertTrue("group.getStudents().contains(petrovStudent)", group.getStudents().contains(petrovStudent));
assertTrue("group.isIdentical(petrovStudent.getGroup())", group.isIdentical(petrovStudent.getGroup()));