Posts by Ivan Alves • 406 points
15 posts
-
1
votes0
answers194
viewsQ: Capture child attribute value using xpath
With xpath I want to get the value of the attribute of href below, however I need to make sure that will be the url present inside the tag li. <li class="event"> <span…
-
3
votes1
answer453
viewsQ: See table row by column name in Laravel?
At Laravel I’m looking for a record in the database by id table, but the code below only consults if the nomenclature in the column is id $prod = $this->produto->find(3) If the column name is…
-
0
votes1
answer71
viewsQ: Annotation @Get does not work in controller
I am trying to customize my url with @Get on Vraptor 4, but it is not recognized, Follow the controller: @Controller public class OlaController { @Inject Result result; @Get("/ola") public void…
-
3
votes1
answer542
viewsQ: No bean corresponds to CDI injection point
I’m looking to implement CDI. But when I use the @Inject annotation I’m notified with this warning "No bean corresponds to the injection point" Code line I’m notified of @Inject private…
-
3
votes3
answers5014
viewsQ: Testing a void method with mockito
How to test a void method with mockito? This is the basic syntax for a return method when(Classe.metodo()).thenReturn(variavelRetorno); However, how do I test a void method?…
-
3
votes1
answer201
viewsQ: Error accessing dao class by test class
I have the following error, when accessing a dao class of a test class: java.lang.Nullpointerexception This is the controller method: @Post("/consultar_lancamento/{codLancamento}") public int…
-
2
votes2
answers895
viewsQ: Junit unit test for default system routines
I have a Java code that checks if there are standard categories registered in the database, if yes it returns true, if he doesn’t return false. public boolean validaEntradaDeDadosPadrao() {…
-
0
votes3
answers438
viewsA: Close in Transaction with Ibernate
I got through that code: Transaction transacao = null; Session sess = Sessao.getSessao(); try { transacao = sess.beginTransaction(); contaDao.atualiza(conta); transacao.commit(); } catch (Exception…
-
2
votes1
answer62
viewsA: column does not obey the Where command of an update
I managed to fix! the problem was the update before the if: public function editar($id) { $data['cal_descricao'] = $this->input->post('descricao'); $this->db->set('cal_descricao',…
-
3
votes1
answer62
viewsQ: column does not obey the Where command of an update
I have a problem. At the moment I make an update, when I use Where only the line with the code informed is updated. however the Description field that I report, its content is replicated for all…
-
1
votes1
answer111
viewsA: Manipulating input date
Ola may have a simpler shape, but this one might work. You can add and remove a class to see if the user has played it or not. function verificarFuncao(){ $('#input').toggleClass('clicado');…
-
1
votes2
answers183
viewsA: Trying to generate a graph of a time series
You can use a for to create the list of years, if the data is in an array, it will be populated according to the Dice Follow a code I made in java following a loop graphDonut = Morris.Donut({…
-
2
votes3
answers438
viewsQ: Close in Transaction with Ibernate
Hello, I need some help. I’m trying to make a transaction on Ibernate. The problem is that by giving a close, the data are modified in the database, but this occurs WARN: WARN…
-
1
votes2
answers316
viewsA: Insert record into bank inside a for using Hibernate
Follow the solution to insert data into the database by Hibernate in a for for (int i = 0; i < duracaoRepeticao; i++) { // é necessario criar um novo objeto da classe LancamentoDados para ele…
-
2
votes2
answers316
viewsQ: Insert record into bank inside a for using Hibernate
I need help, I’m trying to create a fixed expense launch. I have to insert for example 12 records in the database, through a loop inside the for. To enter the data I am using Hibernate, however it…