Posts by brendonmiranda • 126 points
10 posts
-
0
votes2
answers286
viewsA: How to restore a modified file that was error from Git?
step 1: "hide" the modifications you haven’t committed yet. git stash save <descrição> step 2: reset the last commit of the branch taking its modifications to staging area. git reset HEAD~…
gitanswered brendonmiranda 126 -
2
votes1
answer68
viewsA: What Spring annotation I need to use with Mqttcallback messageArrived
You need to inject service in class: @Component public class ProductionCallBack implements MqttCallback { @Autowired private MachineService machineService; } And the Repository in service: @Service…
-
2
votes2
answers598
viewsA: Error in @Onetomany mapping with JPA and Hibernate
In this case you can use a one-way relationship: @Entity @Table(name = "sale") public class Sale implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id;…
-
0
votes2
answers1226
viewsA: How to run a JAR with a specific JRE?
One possibility is to switch to default java. In a linux environment (shell bash) you can use the commands: sudo apt install oracle-java7-set-default sudo apt install oracle-java8-set-default sudo…
javaanswered brendonmiranda 126 -
0
votes1
answer82
viewsA: How to prevent Hibernate from creating columns from the fields of an abstract mother class
You can make use of the @Inheritance annotation in your superclass. Example: import javax.persistence.Inheritance; import javax.persistence.InheritanceType; @Entity @Table(name = "PESSOA")…
-
0
votes2
answers212
viewsA: Failure to Try to Inject Spring Boot Interfaces
Include the @Component annotation on your interface this way: package br.fc.teste.service; import java.util.List; import br.fc.teste.domain.Veiculo; import org.springframework.stereotype.Component;…
-
1
votes1
answer77
viewsA: Get free hour ranges with SQL only
You could achieve that result with a trial. Taking your example literally I quickly developed two procedures to help you achieve this result, see: (Mysql) DROP DATABASE TEST; CREATE DATABASE TEST;…
-
1
votes1
answer99
viewsA: Error in Java database
As the error says: You are trying to insert a value in a column that does not exist in the database, that is, you are trying to insert a value in the column "name", column not existing in your table…
-
0
votes1
answer88
viewsA: java.lang.Nillpointerexception error
I recommend that you edit your question and post the Correntista class to make a deeper analysis. However, taking as a reference the simulation method Mprestimo() of the class Contaj and Contaf,…
javaanswered brendonmiranda 126 -
2
votes1
answer1226
viewsA: Unique index or Primary key Violation
Since you already have previously persisted data in this table, identify the largest id currently added in this table and use the property initialValue from that value, for example: Select max(id)…