Package net.stinfoservices.pacifiq.server.model

Examples of net.stinfoservices.pacifiq.server.model.Profile


        if (profile == null) {
            return;
        }

        try {
            Profile nprofile = entityManager.merge(profile);
            entityManager.remove(nprofile);
            LOGGER.info(MessageFormat.format(ResourceBundle.getBundle("system").getString("OBJECT_DELETED"), this.getClass().getSimpleName(),
                    nprofile.getId()));
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here


    @Override
    public void testFind() throws Exception {
        Uzer uzer = uzerDAO.find(1L);
        Uzer uzerc = new Uzer();
        Program program = new Program();
        Profile profile = new Profile();

        program.setId(1L);
        program.setName(PROGRAM_NAME);
        program.setVersion(1);
        profile.setId(1L);
        profile.setAdministrator(false);
        profile.setLicensesConsultation(false);
        profile.setLicensesEdition(false);
        profile.setProgramsConsultation(false);
        profile.setProgramsEdition(false);
        profile.setName(PROFILE_NAME);
        profile.setVersion(1);
        uzerc.setId(1L);
        uzerc.setEmail(UPDATED_USER_EMAIL);
        uzerc.setName(USER_NAME);
        uzerc.setFirstname(USER_FIRSTNAME);
        uzerc.setProfile(profile);
View Full Code Here

            for (Object o : q.getResultList()) {
                if (o instanceof Object[]) {
                    Object[] oo = (Object[]) o;
                    if (oo.length == 2 && oo[0] instanceof Uzer && oo[1] instanceof Profile) {
                        Uzer uzer = (Uzer) oo[0];
                        Profile profile = (Profile) oo[1];
                        result.add(new UzerProfile(uzer, profile));
                    }
                }
            }
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
        try {
            javax.persistence.Query q2 = entityManager.createQuery("SELECT p FROM " + IModel.DATABASE_PRE + "Profile p "
                    + "where p.id not in(select u.profile.id as id from " + IModel.DATABASE_PRE + "Uzer u)");
            for (Object o : q2.getResultList()) {
                if (o instanceof Profile) {
                    Profile profile = (Profile) o;
                    result.add(new UzerProfile(null, profile));
                }
            }
        } catch (Exception ex) {
            throw new CustomException(ex);
View Full Code Here

    @Override
    public void testFindAll() throws Exception {
        List<Uzer> uzers = uzerDAO.findAll();
        Uzer uzer = new Uzer();
        Program program = new Program();
        Profile profile = new Profile();

        program.setId(1L);
        program.setName(PROGRAM_NAME);
        program.setVersion(1);
        profile.setId(1L);
        profile.setAdministrator(false);
        profile.setLicensesConsultation(false);
        profile.setLicensesEdition(false);
        profile.setProgramsConsultation(false);
        profile.setProgramsEdition(false);
        profile.setName(PROFILE_NAME);
        profile.setVersion(1);
        uzer.setId(1L);
        uzer.setEmail(UPDATED_USER_EMAIL);
        uzer.setName(USER_NAME);
        uzer.setFirstname(USER_FIRSTNAME);
        uzer.setProfile(profile);
View Full Code Here

    @Override
    public void testFindEntries() throws Exception {
        List<Uzer> uzers = uzerDAO.findEntries(1, 1);
        Uzer uzer = new Uzer();
        Program program = new Program();
        Profile profile = new Profile();

        program.setId(1L);
        program.setName(PROGRAM_NAME);
        program.setVersion(1);
        profile.setId(1L);
        profile.setAdministrator(false);
        profile.setLicensesConsultation(false);
        profile.setLicensesEdition(false);
        profile.setProgramsConsultation(false);
        profile.setProgramsEdition(false);
        profile.setName(PROFILE_NAME);
        profile.setVersion(1);
        uzer.setId(1L);
        uzer.setEmail(UPDATED_USER_EMAIL);
        uzer.setName(USER_NAME);
        uzer.setFirstname(USER_FIRSTNAME);
        uzer.setProfile(profile);
View Full Code Here

            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource("/dbunit/dao/admin/uzer-create_no-id.xml")
                    .openStream());
            Uzer uzer = new Uzer();
            Uzer nuzer;
            Program program = new Program();
            Profile profile = new Profile();

            program.setName(PROGRAM_NAME);
            program.setVersion(1);
            profile.setId(1L);
            profile.setAdministrator(false);
            profile.setLicensesConsultation(false);
            profile.setLicensesEdition(false);
            profile.setProgramsConsultation(false);
            profile.setProgramsEdition(false);
            profile.setName(PROFILE_NAME);
            profile.setVersion(1);
            uzer.setId(1L);
            uzer.setEmail(DEFAULT_USER_EMAIL);
            uzer.setName(USER_NAME);
            uzer.setFirstname(USER_FIRSTNAME);
            uzer.setProfile(profile);
View Full Code Here

            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource("/dbunit/dao/admin/uzer-update_aftersave.xml")
                    .openStream());
            Uzer uzer = new Uzer();
            Uzer nuzer;
            Program program = new Program();
            Profile profile = new Profile();
            Set<Program> programsWithConsultationRights = new HashSet<Program>();
            Set<Program> programsWithEditionRights = new HashSet<Program>();

            program.setId(1L);
            program.setName(PROGRAM_NAME);
            program.setVersion(1);
            profile.setId(1L);
            profile.setAdministrator(false);
            profile.setLicensesConsultation(false);
            profile.setLicensesEdition(false);
            profile.setProgramsConsultation(false);
            profile.setProgramsEdition(false);
            profile.setName(PROFILE_NAME);
            profile.setVersion(1);
            uzer.setId(1L);
            uzer.setEmail(UPDATED_USER_EMAIL);
            uzer.setName(USER_NAME);
            uzer.setFirstname(USER_FIRSTNAME);
            uzer.setProfile(profile);
View Full Code Here

    @DatabaseTearDown(value = EMPTY_DATASET, type = DatabaseOperation.DELETE)
    @Override
    public void testRemove() throws Exception {
        Uzer uzer = new Uzer();
        Program program = new Program();
        Profile profile = new Profile();
        Set<Program> programsWithConsultationRights = new HashSet<Program>();
        Set<Program> programsWithEditionRights = new HashSet<Program>();

        program.setId(1L);
        program.setName(PROGRAM_NAME);
        program.setVersion(1);
        profile.setId(1L);
        profile.setAdministrator(false);
        profile.setLicensesConsultation(false);
        profile.setLicensesEdition(false);
        profile.setProgramsConsultation(false);
        profile.setProgramsEdition(false);
        profile.setName(PROFILE_NAME);
        profile.setVersion(1);
        uzer.setId(1L);
        uzer.setEmail(DEFAULT_USER_EMAIL);
        uzer.setName(USER_NAME);
        uzer.setFirstname(USER_FIRSTNAME);
        uzer.setProfile(profile);
View Full Code Here

    @ExpectedDatabase(value = EMPTY_DATASET, assertionMode = DatabaseAssertionMode.NON_STRICT)
    @DatabaseTearDown(value = EMPTY_DATASET, type = DatabaseOperation.DELETE)
    public void testRemove2() throws Exception {
        Uzer uzer = new Uzer();
        Program program = new Program();
        Profile profile = new Profile();
        Set<Program> programsWithConsultationRights = new HashSet<Program>();
        Set<Program> programsWithEditionRights = new HashSet<Program>();

        program.setId(1L);
        program.setName(PROGRAM_NAME);
        program.setVersion(1);
        profile.setId(1L);
        profile.setAdministrator(false);
        profile.setLicensesConsultation(false);
        profile.setLicensesEdition(false);
        profile.setProgramsConsultation(false);
        profile.setProgramsEdition(false);
        profile.setName(PROFILE_NAME);
        profile.setVersion(1);
        uzer.setId(1L);
        uzer.setEmail(UPDATED_USER_EMAIL);
        uzer.setName(USER_NAME);
        uzer.setFirstname(USER_FIRSTNAME);
        uzer.setProfile(profile);
View Full Code Here

TOP

Related Classes of net.stinfoservices.pacifiq.server.model.Profile

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.