Questions tagged as 'java'

1
answer

JPA error hibernate = foreign key is returning null

After much research, without success, I decided to post my doubts. I'm using JPA / Hibernate and I have two tables: a Pessoa and a Funcionário . The error occurs when I save my data, the foreign key pessoa_id is empty,...
asked by 01.07.2016 / 21:16
1
answer

How to manipulate multiple inputs with same name in Java?

How do I manipulate in the backend using multiple input 's with the same name ? For example: <input type='text' name='telefone' ><br> <input type='text' name='telefone' ><br> <inpu...
asked by 22.06.2016 / 01:52
1
answer

What is the (real) utility of the javax.persistence.Transient annotation?

The @Transient annotation serves to inform JPA that that attribute is not mapped to the table and / or should not be persisted. In addition, after the entity that has annotated attributes with @Transient is persisted, these attributes...
asked by 09.11.2017 / 16:36
1
answer

How to display the contents of a .txt file on the screen?

I am using JFrame to try to display the contents of txt files in a window and then delete the whole file. However, when I put it to display, it deletes the file but does not display on the screen that I created with JFrame . What co...
asked by 10.11.2017 / 20:50
2
answers

Select in Hibernate does not return extended class

I have a class, Vendor, that is extended from class Pessoa . In method listarFornecedores of class FOrnecedorDao : public List<Fornecedor> listarFornecedores() { session = HibernateUtil.getSessionFactory().openS...
asked by 23.01.2017 / 13:39
1
answer

How to turn this query into a JPQL?

I have the following query in the postgres database: select * from trabalha_projeto tp inner join Empregado e on e.matricula = tp.empregado How does it transform it into a JPQL query? I'm having a hard time returning values: First: not...
asked by 05.04.2016 / 03:33
1
answer

How to create and populate a table using jquery and database?

I need to create a table in HTML that populates rows and columns with data coming from a specific table in my database. But I want whenever a new data is inserted into this database table, it automatically appears to the user in the HTML table....
asked by 06.04.2016 / 15:55
2
answers

Hibernate Validator @CPF that can be null

I am using Hibernate Validator with the @CPF annotation. It is validating beauty, the problem is that my system may have the invalid CPF field (null) and Hibernate does not accept this. I put the field with @Collumn (nullable = true) but...
asked by 02.04.2016 / 07:07
2
answers

Test without "messing up" (adding data) to the database

I'm having trouble doing integration testing. I test my database functions. My web application does not use any framework database connection and I am not able to do tests without messing up my database. I would like to know how to test wit...
asked by 29.01.2016 / 19:26
2
answers

How to implement Swipe To Refresh in WebView?

I want to implement Swipe To Refresh in my WebView, is it possible? I know I have Pull To Refresh but I can not download add-ons (dependencies) at the moment. I researched a lot on the internet and found something like this: browser.loadUrl("h...
asked by 24.02.2016 / 03:01