use of com.autentia.tnt.businessobject.Position in project TNTConcept by autentia.
the class PositionManager method getEntityById.
/**
* Get position by primary key.
*
* @return position selected by id.
*/
public Position getEntityById(int id) {
Position position = positionDAO.loadById(id);
position.initChanges();
return position;
}
use of com.autentia.tnt.businessobject.Position in project TNTConcept by autentia.
the class PositionManager method updateEntity.
/**
* Update position.
*/
public void updateEntity(Position position) {
// get changes for history
Position changes = position.getChanges();
// update the entity
positionDAO.update(position);
// tracking entity changes
Position positionHibSession = positionDAO.loadById(position.getId());
positionHibSession.setChanges(changes);
this.trackEntityChanges(positionHibSession);
}
use of com.autentia.tnt.businessobject.Position in project TNTConcept by autentia.
the class DepartmentBean method deletePosition.
public String deletePosition() {
final UIData table = (UIData) FacesUtils.getComponent("department:positions");
final Position toDelete = (Position) table.getRowData();
department.getPositions().remove(toDelete);
return NavigationResults.EDIT;
}
use of com.autentia.tnt.businessobject.Position in project TNTConcept by autentia.
the class DepartmentBean method create.
/**
* Go to create page
* @return forward to CREATE page
*/
public String create() {
department = new Department();
// se inserta el puesto 'Indefinido' en caso de existir
final PositionSearch positionSearch = new PositionSearch();
positionSearch.setName("Indefinido");
List<Position> positions = PositionManager.getDefault().getAllEntities(positionSearch, new SortCriteria("name", true));
Set<Position> positionsSet = new HashSet<Position>();
for (Position position : positions) {
positionsSet.add(position);
}
department.setPositions(positionsSet);
return NavigationResults.CREATE;
}
use of com.autentia.tnt.businessobject.Position in project TNTConcept by autentia.
the class DepartmentBean method getAllPositions.
public List<SelectItem> getAllPositions() {
final PositionSearch notDeletedSearch = new PositionSearch();
notDeletedSearch.setDeleted(false);
final List<Position> refs = PositionManager.getDefault().getAllEntities(notDeletedSearch, new SortCriteria("name"));
final List<SelectItem> ret = new ArrayList<SelectItem>();
for (Position ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
Aggregations