Examples of SessionFactory


Examples of org.hibernate.SessionFactory

    }
    return group;
  }
 
  public BaseRight getBaseRight(long baseRightID) {
    SessionFactory sessionFactory = null;
    Session session = null;
    BaseRight baseRight = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();
      Criteria c = session.createCriteria(BaseRight.class);
      c.add(Restrictions.idEq(baseRightID));
      List<BaseRight> lstRights = c.list();
      if(lstRights != null && lstRights.size() > 0) {
        baseRight = lstRights.get(0);
View Full Code Here

Examples of org.hibernate.SessionFactory

    validateNullEntries(assignGroup);
    performDBAction(assignGroup, DBActionCriteria.Upsert);
  }
 
  public List<AssignedRightsGroup> getAllAssociatedGroups(IPermisibleResource resource, RightsGroup group) {
    SessionFactory sessionFactory = null;
    Session session = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();
      Criteria c = session.createCriteria(AssignedRightsGroup.class);
      if(resource != null) {
        c.add(Restrictions.eq("resourceTypeID", resource.getResourceTypeID()))
      }
     
View Full Code Here

Examples of org.hibernate.SessionFactory

    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

Examples of org.hibernate.SessionFactory

    // 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

Examples of org.hibernate.SessionFactory

    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

Examples of org.hibernate.SessionFactory

      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

Examples of org.hibernate.SessionFactory

    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

Examples of org.hibernate.SessionFactory

    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

Examples of org.jboss.ejb3.endpoint.SessionFactory

   }
  
   @Test
   public void testSession() throws Throwable
   {
      SessionFactory factory = new SessionFactory() {
         public Serializable createSession(Class<?>[] initTypes, Object[] initValues)
         {
            return UUID.randomUUID();
         }
View Full Code Here

Examples of org.menacheri.jetclient.app.impl.SessionFactory

    LoginBuilder builder = new LoginBuilder().username("user")
        .password("pass").connectionKey("Zombie_ROOM_1_REF_KEY_1")
        .jetserverTcpHostName("localhost").tcpPort(18090)
        .jetserverUdpHostName("255.255.255.255").udpPort(18090);
    LoginHelper loginHelper = builder.build();
    SessionFactory sessionFactory = new SessionFactory(loginHelper);
    ScheduledExecutorService taskExecutor = Executors.newSingleThreadScheduledExecutor();
    for(int i = 1; i<=50; i++){
      Session session = sessionFactory.createAndConnectSession();
      addDefaultHandlerToSession(session);
      GamePlay task = null;
      if((i % 2) == 0){
        task = new GamePlay(IAM.DEFENDER, session);
      }
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.