}
@Override
public ParticipantVO create(ParticipantVO p) throws MeException {
if (p.getId() != null && p.getId() != 0) {
throw new MeException("Cannot create already created participant");
}
Location location = new Location(p.getLatitude(), p.getLongitude(), p
.getLocationString(), p.getRadius());
Participant pi = null;
try {
pi = pm.createParticipant(p.getName(), p.getGender(), location, p
.getEmail(), p.getFacebookId());
pm.addHasKnowledge(pi, p.getHasSubjects(), 1, pi);
pm.addNeedKnowledge(pi, p.getNeedSubjects(), 1, pi);
save(pi, p);
} catch (MentorException m) {
throw new MeException(m.getMessage());
}
if (pi != null) {
return ValueObjectGenerator.create(pi);
} else {
return null;