Created
April 28, 2010 14:01
-
-
Save pedromtavares/382177 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void removerLojas(){ | |
Query query = manager.createQuery("select l from Loja l"); | |
List<Loja> lojas = query.getResultList(); | |
Loja loja = lojas.get(0); | |
List<Produto> produtos = loja.getProdutos(); | |
Produto produto = produtos.get(0); | |
manager.getTransaction().begin(); | |
manager.remove(lojas.get(1)); | |
manager.remove(produto); | |
manager.getTransaction().commit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment