1 - Vc deveria atualizar o objeto (itemcomanda) e então dar um update no objeto e não fazer isso via HQL, afinal vc usa o hibernate e a jpa para não precisar usar SQL (nem HQL no caso).
2 - Acho que a forma que você está usando a transação pode dar algum problema. Crie uma variável para a transação, e a partir da variável que vai referenciar o objeto vc dá o begin e o commit. O jeito que você está fazendo me dá impressão que são criadas dois objetos de transação. Vc dá begin em um e commit no outro. Isso é só uma suposição, não vi nos docs.
Atualizou os dados na tabela, mas recebi a seguinte excessão:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: EntityManager is closed
at org.hibernate.ejb.EntityManagerImpl.getSession(EntityManagerImpl.java:66)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:93)
at interfaces.Dao.Movimentacao.ItemComandaDao.findAllItensComandaByComanda(ItemComandaDao.java:32)
at interfaces.BI.Movimentacao.ComandaBI.updateOrdemItem(ComandaBI.java:105)
at interfaces.BI.Movimentacao.ComandaBI.transfereItens(ComandaBI.java:119)
at interfaces.Controller.Movimentacao.ComandaController.transfereItens(ComandaController.java:89)
at interfaces.Views.Movimentacao.ComandaFrame.juntarComandas(ComandaFrame.java:1115)
at interfaces.Views.Movimentacao.ComandaFrame.access$9(ComandaFrame.java:1104)
at interfaces.Views.Movimentacao.ComandaFrame$9.actionPerformed(ComandaFrame.java:1042)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Galera … consegui … achu q o problema era nos .jars do Hibernate.
É q os q eu tenho aqui são meiuo antigos.
Bom resolvi alterando o código que retorna o EntityManager no GenericDao :
[quote=tominem]Galera … consegui … achu q o problema era nos .jars do Hibernate.
É q os q eu tenho aqui são meiuo antigos.
Bom resolvi alterando o código que retorna o EntityManager no GenericDao :