Questions tagged as 'jpa'

0
answers

Error when calling WebService that returns a list (JPA)

Hello, I can not return a list of requests through the WebService: public List<Pedido> getPedido() throws Exception { String query = "SELECT p FROM Pedido p"; TypedQuery<Pedido> typedQuery = entityManager.createQuery(query...
asked by 14.11.2015 / 13:29
0
answers

Dependency Injection Doubt on hibernate event listener

I wonder if there is any way I can inject features into a Hibernate Event Listener using vraptor 3.5. I wanted to be able to simulate the behavior of a trigger that we have in the database. And this Listener would do an update on the bank. I...
asked by 10.06.2015 / 16:00
0
answers

Error while displaying a collection of phones and emails from a contact

I want to display a list of contacts with phones and emails on an XHTML (JSF + PrimeFaces) page. I can display everything I want in a test class: package com.fercosmig.testes; import java.util.List; import javax.persistence.EntityManager;...
asked by 12.08.2015 / 23:26
0
answers

Bean Class not found - JavaWeb

Good evening, I'm doing my tcc on Java Web and doing data persistence with JPA and Hibernete. I made CRUD seemingly right, but when I click the register button it gives this error. action="#{empresaController.incluir()}": Target Unreachable, i...
asked by 03.04.2015 / 04:16
0
answers

Unexpected behavior in unidirectional @OneToMany generation (additional FK columns being created)

Below are the two entities with the relationships in a unidirectional way: CustomerService.java @Entity @Table(name = "customer_service") @Multitenant @TenantDiscriminatorColumn(name = "tenant_id", discriminatorType = DiscriminatorType.IN...
asked by 30.03.2015 / 01:57
0
answers

Hibernate + Maven + Glassfish

I have a Maven Project, which uses Hibernate, and has all dependencies ok. I have already created connection pool in glassfish. The problem is that even the class mapped with the hibernate annotations tip giving error talking that must...
asked by 09.03.2015 / 13:38
2
answers

persistence.xml for development and another for production?

I have my persistence.xml set to a local database. <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/meubanco"/> <property name="hibernate.connection.username" value="usuario"/> <property name="...
asked by 14.10.2014 / 15:14
2
answers

Why does hibernate not list results if the select query calls null field of the table?

I have a Class-Entity Product. @Entity public class Produto implements Serializable{ @Id @GeneratedValue private long id; @Column(length = 70, nullable = false) private String cod; @Column(length = 100, nullable = f...
asked by 15.09.2016 / 18:57
0
answers

Instability retrieving updated objects list

I'm facing problems with Hibernate that seems to be related to the cache object. I have an entity, let's call it A, with a list attribute mapped with @OneToMany (cascade = CascadeType.ALL, mappedBy = "atributo") . The objects in the lis...
asked by 19.11.2014 / 18:04
0
answers

Adding results

I'm starting to use the framework uaiCriteria and I need a result that is a sum of records in a given period. Something like (simplified): select sum(valor), sum(desconto), data, idpessoa from tabela group by data, idpessoa I did:...
asked by 18.11.2014 / 18:00