Package org.hibernate

Examples of org.hibernate.SessionFactory$SessionFactoryOptions


    validateNullEntries(permissionMaster);
    performDBAction(permissionMaster, DBActionCriteria.Upsert);
  }
 
  public List<Permission> getAllPermissionMaster(BaseRight right, IPermissionEntity entity, IPermisibleResource resource) {
    SessionFactory sessionFactory = null;
    Session session = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();
      Criteria criteria = session.createCriteria(Permission.class);
      if(right != null) {
        criteria.add(Restrictions.eq("right", right));
      }
      if(resource != null) {
View Full Code Here


    // TODO Auto-generated method stub

  }

  public List<BOFile> getFiles(long taskID, 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("taskID", taskID));
      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();
View Full Code Here

    performDBAction(originalFile, DBActionCriteria.Update);
    performDBAction(newFile, DBActionCriteria.Update);
  }

  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

      close(sessionFactory, session);
    }
  }

  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

    return getAllProjects(company, user, null);
  }

  public List<BOProject> getAllProjects(BOCompany company, BOUser user, ProjectStatus projectStatus) {
    //initCustomFields();
    SessionFactory sessionFactory = null;
    Session session = null;
    try {

      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

    return false;
  }

  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

      throw new InsufficientPrivilagesException();
    }
  }

  private void deleteTasks(BOUser user, BOProject project) {
    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

  public static void initCustomFields() {
    if (BOCustomField.CustomTaskModule != null) {
      return;
    }
    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

  /* (non-Javadoc)
   * @see com.zycus.dotproject.impl.ICompanyManager#getAllCompanies(com.zycus.dotproject.bo.BOUser, com.zycus.dotproject.bo.BOCompany)
   */
  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

 
  /* (non-Javadoc)
   * @see com.zycus.dotproject.impl.IDepartmentManager#getAllDepartments(com.zycus.dotproject.bo.BOUser)
   */
  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

TOP

Related Classes of org.hibernate.SessionFactory$SessionFactoryOptions

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.