Posts by Jony Lima • 102 points
7 posts
-
1
votes1
answer2231
viewsA: How to do Inner Join in Jpa Springboot
To do Inner Join with JPQL it is not necessary to compare the ids, you can do so. select m.id, m.nome, m.crm, e.descricao from Medico m inner join m.especialidade e If you want your result to be…
-
1
votes1
answer103
viewsA: Problem with JPA Hibernate
You can use the JPA @Mapsid annotation to say that the foreign key of one entity is associated as the primary key of another and before entering you will have to set the Document to your bgo. Bgo:…
-
0
votes1
answer471
viewsA: Error - java.util.Date cannot be cast to java.sql.Date when saving data
This error is happening because the parse method of the Simpledateformat class returns a Date from the java.util package and you are trying to cast for a java.sql.Date. You can resolve this by…
-
1
votes2
answers56
viewsA: Add element to an Arraylist only if it does not exist (Android)
This is happening because internally the contains() method of the Arraylist class makes use of the equals() method, so you will need to implement the equals method,. @Override public int hashCode()…
-
0
votes3
answers100
viewsA: Error doing an INSERT in Postgresql database
You can simply implement Crudrepository and use the save method by passing your object. @Repository public interface ConteudoRepository implements CrudRepository<Conteudo, Long>{ } In your…
-
1
votes3
answers724
viewsA: Ignore the first line of a file
In Java 8 you can do so: Path path = Paths.get("C:\\temp\\apartamentos.csv"); Files.lines(path).skip(1L).forEach(linha->{ System.out.println(linha); }); In the skip you pass the amount of rows…
-
1
votes2
answers578
viewsA: Working with two txt files
I had no way to test,but tries to store the contents of the files in two lists,example: public static void main(String[] args) throws Exception{ File file = new…