Examples of openSession()


Examples of org.hibernate.SessionFactory.openSession()

      log.finest("creating hibernate session with connection "+connection);
      session = sessionFactory.openSession(connection);

    } else {
      log.finest("creating hibernate session");
      session = sessionFactory.openSession();
    }

    return session;
  }
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

    final EntityManagerFactory emf = Persistence.createEntityManagerFactory( "jpajtastandalone", TestHelper.getEnvironmentProperties() );
    assertThat( HibernateEntityManagerFactory.class.isAssignableFrom( emf.getClass() ) ).isTrue();
    SessionFactory factory = ( (HibernateEntityManagerFactory) emf ).getSessionFactory();
    assertThat( factory.getClass() ).isEqualTo( OgmSessionFactoryImpl.class );

    Session s = factory.openSession();
    assertThat( s.getClass() ).isEqualTo( OgmSessionImpl.class );
    assertThat( s.getSessionFactory().getClass() ).isEqualTo( OgmSessionFactoryImpl.class );
    s.close();

    EntityManager em = emf.createEntityManager();
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

    session.getNamedQuery("");
    sCtrl.setMatcher(MockControl.ALWAYS_MATCHER);
    sCtrl.setReturnValue(query);

    sfCtrl.expectAndReturn(sf.openSession(), session);
    sfCtrl.replay();
    sCtrl.replay();
    queryCtrl.replay();

    configuration.setProcessDefinitions(new ProcessDefinition[] { (ProcessDefinition) definition.getObject() });
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

    SessionFactory sessionFactory = null;
    Session session = null;

    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();
     
      performDBAction(objToSave, criteria, session);

    } catch (Exception a_th) {
      throw new RuntimeException(a_th);
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

    SessionFactory sessionFactory = null;
    Session session = null;
    RightsGroup group = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();
      Criteria c = session.createCriteria(RightsGroup.class);
      c.add(Restrictions.eq("groupName", groupName));
      List<RightsGroup> lstRights = c.list();
      if(lstRights != null && lstRights.size() > 0) {
        group = lstRights.get(0);
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

    SessionFactory sessionFactory = null;
    Session session = null;
    RightsGroup group = null;
    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();
      Criteria c = session.createCriteria(RightsGroup.class);
      c.add(Restrictions.idEq(groupID));
      List<RightsGroup> lstRights = c.list();
      if(lstRights != null && lstRights.size() > 0) {
        group = lstRights.get(0);
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

    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.openSession()

  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.openSession()

  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.openSession()

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