I have a Dynamic Web Project in Eclipse and I have been constantly receiving this error: java.lang.ClassNotFoundException: could not load requested class: com.mysql.jdbc.Driver.
My persistence.xml file:
<persistence-unit name="casos">...
Good Night.
I have the following error in Hibernate:
org.hibernate.AnnotationException: Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements: bestroute.modelo.Peca.grupoPeca
I can not display on...
I'm having an error opening the screen with the search results in the database.
The error is in the image below.
Debugging, data is coming from the database.
In the other image, the Server Log appears
MyNeighborhoods@Entity@Table(nam...
What is the equivalent function of LEFT () in JPA?
I need to get only the first 6 characters of a field.
The equivalent select in sql would be:
select left(campo,6), count(*) qtd
from tabela
group by left(campo,6)
I have 2 tables in my software that are not being generated correctly. SQL is generated, but when verifying in MySQL, not the meetings.
If I change the tag to: <property name="hibernate.hbm2ddl.auto" value="validate"/> or <...
Is there any way to show the SQL generated by JPA / Hibernate without being enabled by the <property name="hibernate.show_sql" value="true"/> property?
The difficulty is that I need to monitor only one query, and if I turn on...
A subsidiary has a product - relationship @OneToOne - and a product has several histories.
Implemented registration method:
public class CadastroProdutoService implements Serializable {
private static final long serialVersionUID = 1...
I have a system where all tables in the database have a column empresa , which is part of PRIMARY KEY .
In the client table, I have a column id (autoincrement), which together with empresa form a composite key, mappe...
I need to put in a array of double the data of the quantity field that comes from the database. When doing this with the following code:
static List<Historico> listaComCincoUltimosMeses = new ArrayList<Historico>
();...
How do I map with Hibernate @OneToOne and save only if the information has data in the related table?
Example:
public class ObservacaoPessoa {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Integer id;...