Subversion Repositories WebE

Compare Revisions

Last modification

Ignore whitespace Rev 26 → Rev 27

/trunk/src/ch/ffhs/webE/dao/RelationshipTypeDAOImpl.java
57,11 → 57,11
* relationshipType
*/
@Override
public boolean saveRelationshipType(RelationshipType relType)
public boolean saveOrUpdateRelType(RelationshipType relType)
{
try
{
session.save(relType);
session.saveOrUpdate(relType);
return true;
}
catch (Exception e)
83,8 → 83,9
{
try
{
User user = (User) session.get(RelationshipType.class, relTypeID);
session.delete(user);
RelationshipType relType = (RelationshipType) session.get(
RelationshipType.class, relTypeID);
session.delete(relType);
return true;
}
catch (Exception e)
94,4 → 95,24
return false;
}
}
 
/**
* Used to get a relationship type by ID
*/
@Override
public RelationshipType listRelTypeById(int relTypeID)
{
RelationshipType relType = null;
try
{
relType = (RelationshipType) session.get(RelationshipType.class,
relTypeID);
}
catch (Exception e)
{
e.printStackTrace();
// TODO: Logging
}
return relType;
}
}