Perseverance with Vaadin

I am trying to recognize vaadin. I am really confused about how to do any kind of application development with persistence, because if I have a link to service level objects, they are saved in the session, and I really don't want to. Persistence is simply not serializable.

My thing is that I have an already created application that uses Spring, and I am creating a new interface for it with Vaadin. I can add Spring stuff to my Vaadin application, but it will be saved in the session. Any tips?

By the way, how do you post on Vaadin forums? I can not find the message button or registration method :)

+3
source share
5 answers

, . ThreadLocal Service. ThreadLocal Start transactionEnd Application.

: http://vaadin.com/book/-/page/advanced.global.html

0

:

  • . .
  • , , .
  • ( model-view-controller: )
  • / , , .
  • , , .., ( : TreeTable - ) - . issue # 9516)
+1

. factory:

    public Session getSession() {
    Session currentSession = HibernateUtil.getSessionFactory()
            .getCurrentSession();
    if(!currentSession.getTransaction().isActive()) {
        currentSession.beginTransaction();
    }
    return currentSession;
}

, -, , .

, HQL- , .

    public List<DataClass> getEntriesforDate(Date date, Integer key) {
    return mainApp.getSession().getNamedQuery(DataClass.NAMEDQUERY)
            .setParameter("key", key).list();
}

ORM, , , :

getSession().merge(o);

Waadin Wiki:

0

Vaadin , .

-2

Source: https://habr.com/ru/post/1759071/


All Articles