Examples of openSession()


Examples of org.hibernate.SessionFactory.openSession()

  public List<BOFile> getAllVersions(long versionID, BOUser user) {
    SessionFactory sessionFactory = null;
    Session session = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();
      String query = "from BOFile as f where f.rootFileID = :rootFileID";
      Query q = session.createQuery(query);
      q.setParameter("rootFileID", versionID);
      return q.list();
    } catch (Exception a_th) {
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

  public List<BOFile> getAllFile(BOProject project, BOUser user) {
    SessionFactory sessionFactory = null;
    Session session = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();
      Criteria criteria = session.createCriteria(BOFile.class);
      criteria.add(Restrictions.eq("project", project));
      criteria.add(Restrictions.sqlRestriction(" file_id in(select max(fl.file_id) from files as fl group by fl.file_version_id) "));
      return criteria.list();
    } catch (Exception a_th) {
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

      System.out.println("ProjectManagerImpl.getAllProjects() started " + user.getLoginName());
      System.out.println("ProjectManagerImpl.getAllProjects()  " + user.getUserType());

      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();

      Criteria criteria = session.createCriteria(BOProject.class);
      // List<BOProject> toProjectList = new ArrayList<BOProject>();

      if (projectStatus != null) {
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

  public BOProject getCompleteProject(long projectId) {
    SessionFactory sessionFactory = null;
    Session session = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();

      BOProject project = (BOProject) session.get(BOProject.class, projectId);
      System.out.println(project.getTasks());

      return project;
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

    SessionFactory sessionFactory = null;
    Session session = null;
    String strQuery = "delete from BOTask where taskID=";
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();
      for (BOHistory history : project.getCurrentHistoryForProject()) {
        if (history.getHistoryAction() == HistoryAction.Delete && history.getHistoryTable() == HistoryTable.Tasks) {
          Query query = session.createQuery(strQuery + history.getHistoryItem());
          int rows = query.executeUpdate();
        }
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

    }
    SessionFactory sessionFactory = null;
    Session session = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();

      Criteria criteria = session.createCriteria(BOCustomField.class);
      criteria.add(Restrictions.ilike("customFieldModule", "tasks"));
      criteria.add(Restrictions.ilike("customFieldName", "Module"));
      BOCustomField.CustomTaskModule = (BOCustomField) criteria.list().get(0);
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

  public List<BOCompany> getAllCompanies(BOUser user) {
    SessionFactory sessionFactory = null;
    Session session = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();

     
     
      if(user.getUserType()==UserType.Administrator)
      {
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

  public List<BODepartment> getAllDepartments(BOUser user) {
    SessionFactory sessionFactory = null;
    Session session = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();

     
     
      if(user.getUserType()==UserType.Administrator)
      {
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

  public List<BOUser> getAllUsers() {
    SessionFactory sessionFactory = null;
    Session session = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();

      Criteria criteria = session.createCriteria(BOUser.class);
      session.flush();
     
      return criteria.list();
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

    SessionFactory sessionFactory = null;
    Session session = null;
    BOUser user = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();

      Query query = session.createQuery("from BOUser as user where user.loginName = :username and user_password = MD5(:password)");
      query.setString("username", userName);
      query.setString("password", password);
      List<BOUser> lstUsers = query.list();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.