Examples of HibernateUtil


Examples of com.dotmarketing.db.HibernateUtil

     * @param inode inode of the object tagged
     * @return list of all the TagInode where the tags are associated to the object
     */
  public static List getTagInodeByInode(String inode) {
        try {
            HibernateUtil dh = new HibernateUtil(TagInode.class);
            dh.setQuery("from tag_inode in class com.dotmarketing.tag.model.TagInode where inode = ?");
            dh.setParam(inode);

            List list = dh.list();
          return list;

        } catch (Exception e) {
            Logger.warn(Tag.class, "getTagInodeByInode failed:" + e, e);
        }
View Full Code Here

Examples of net.sf.gilead.core.hibernate.HibernateUtil

    else {
      if (usingJpa) {
        util = new HibernateJpaUtil((EntityManagerFactory) factory);
      }
      else {
        util = new HibernateUtil((SessionFactory) factory);
      }
    }

    // TODO: This should actually be a session bound proxy store instead of a global one
    InMemoryProxyStore proxyStore = new InMemoryProxyStore();
View Full Code Here

Examples of net.sf.gilead.core.hibernate.HibernateUtil

  {
    super.init();
   
  //  Bean Manager initialization
  //
    HibernateUtil persistenceUtil = new HibernateUtil();
    persistenceUtil.setSessionFactory(HibernateContext.getSessionFactory());

    PersistentBeanManager beanManager = new PersistentBeanManager();
    beanManager.setPersistenceUtil(persistenceUtil);
    beanManager.setProxyStore(new StatelessProxyStore());
    setBeanManager(beanManager);
View Full Code Here

Examples of net.sf.gilead.core.hibernate.HibernateUtil

public class HibernateAdapter implements ModelAdapter {
    private PersistentBeanManager beanManager;

    public HibernateAdapter(final SessionFactory sessionFactory) {
        // configure gilead
        final HibernateUtil persistenceUtil = new HibernateUtil();
        persistenceUtil.setSessionFactory(sessionFactory);

        // TODO: This should actually be a session bound proxy store instead of a global one
        final InMemoryProxyStore proxyStore = new InMemoryProxyStore();
        proxyStore.setPersistenceUtil(persistenceUtil);
View Full Code Here

Examples of net.sf.gilead.core.hibernate.HibernateUtil

      }
    } else {
      if (usingJpa) {
        util = new HibernateJpaUtil((EntityManagerFactory)factory);
      } else {
        util = new HibernateUtil((SessionFactory) factory);
      }     
    }
   
        // TODO: This should actually be a session bound proxy store instead of a global one
    InMemoryProxyStore proxyStore = new InMemoryProxyStore();
View Full Code Here

Examples of net.sf.myway.hibernate.HibernateUtil

            parent.addChild(r);
          }
        }
        monitor.worked(2);
        monitor.setTaskName(Messages.NewRegionWizard_SaveRegion);
        final HibernateUtil con = HibernateActivator.getDefault().getConnection();
        con.persist(r);
      }
    });
  }
View Full Code Here

Examples of net.sf.myway.hibernate.HibernateUtil

    if (!_selection.isEmpty() && _selection instanceof IStructuredSelection) {
      final Object f = ((IStructuredSelection) _selection).getFirstElement();
      if (f instanceof Region)
        r.setParent((Region) f);
    }
    final HibernateUtil con = HibernateActivator.getDefault().getConnection();
    monitor.worked(2);
    monitor.setTaskName(Messages.NewRegionWizard_SaveRegion);
    con.runTransaction(new DBAction() {
      @Override
      public void run(final Session session) {
        // FIXME can be right
        final Region er = new Region();
        session.persist(er);
View Full Code Here

Examples of net.sf.myway.hibernate.HibernateUtil

  /**
   * @see net.sf.myway.map.da.MapDA#delete(net.sf.myway.map.da.entities.MapObject)
   */
  @Override
  public void delete(final MapObject obj) {
    final HibernateUtil con = getCon();
    final List<MapNodeRef> nodes = obj.getNodes();
    final List<Object> toDel = new ArrayList<Object>();
    for (final MapNodeRef ref : nodes) {
      toDel.add(ref);
      ref.setNode(null);
    }
    obj.setNodes(null);
    toDel.add(obj);
    con.delete(toDel);
  }
View Full Code Here

Examples of net.sf.myway.hibernate.HibernateUtil

   * @see net.sf.myway.map.da.MapDA#getObjects(double, double, double, double)
   */
  @Override
  public List<MapObject> getObjects(final double longMin, final double longMax,
    final double latMin, final double latMax) {
    final HibernateUtil con = getCon();
    return con.getList("from " + MapObject.class.getName()
      + " o where (o.boundingBox.east.val >= ? and o.boundingBox.west.val <= ?) and"
      + " (o.boundingBox.north.val >= ? and o.boundingBox.south.val <= ?)", longMin, longMax,
      latMin, latMax);
  }
View Full Code Here

Examples of net.sf.myway.hibernate.HibernateUtil

  /**
   * @see net.sf.myway.map.da.MapDA#save(net.sf.myway.map.da.entities.MapObject)
   */
  @Override
  public void save(final MapObject... object) {
    final HibernateUtil con = getCon();
    con.runTransaction(new DBAction() {
      @Override
      public void run(final Session session) {
        for (final MapObject obj : object)
          if (obj.getId() == null)
            session.persist(obj);
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.