Package server.hibernate

Examples of server.hibernate.Role


     */
    @Test
    public void testGetRoleByName() {
        System.out.println("getRoleByName");
        String name = "manager";    
        Role result = this.serviceFacadeSmeny.getRoleByName(name);
        assertEquals(true, result!=null);      
    }
View Full Code Here


   
    public static List getAllRoles(){
        String hql = "from Role";
        List resultList = Test.executeHQLQuery(hql);
        for(Object o: resultList) {
            Role role = (Role)o;
            System.out.println(role.getRoleId() + " " + role.getName());
        }
        return resultList;
    }
View Full Code Here

                tableData[i][j++] = shift.getName();
                tableData[i][j++] = sdf.format(shift.getFromTime());                
                tableData[i][j++] = sdf.format(shift.getToTime());

                for (Object obj : rolesList) {
                    Role role = (Role) obj;
                    if (role.getRoleId() == shift.getIdWorkshiftRole()) {
                        tableData[i][j++] = role.getName();
                        break;
                    }
                }
                //tableData[i][j++] = shift.getIdWorkshiftRole(); //predelat na jmeno role
                tableData[i][j++] = shift.getStatus();
View Full Code Here

    public void generateComboBoxRoles() {
        List rolesList = ServiceFacade.getInstance().getAllRoles();
        String[] roles = new String[rolesList.size()];
        int iter = 0;
        for (Object obj : rolesList) {
            Role role = (Role) obj;
            roles[iter++] = role.getName();
        }
        modelRoles = new javax.swing.DefaultComboBoxModel(roles);
    }
View Full Code Here

            return;
        }
       
        tw.setStatus(1);      
        //List l =  Test.executeHQLQuery("from Role r where r.name='" + roleString + "'");
        Role role = ServiceFacade.getInstance().getRoleByName(roleString);
        tw.setIdWorkshiftRole(role.getRoleId());
        System.out.println("TW: " + tw.getName() + " " + tw.getFromTime() + " " + tw.getToTime());
        //Test.saveToDb(tw);       
        ServiceFacade.getInstance().createNewTypewWorkShift(tw);
        this.loadAllData();
        this.shiftTable.setModel(SmenyController.getInstance().getModelTypeWorkShift());
View Full Code Here

TOP

Related Classes of server.hibernate.Role

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.