Questions tagged as 'java'

1
answer

Error using Mock: Wanted but not invoked: Actually, there were zero interactions with this mock

I am making a list of exercises and I am in doubt about the following:    Exercise 3 - The verify method, from the org.mockito.Mockito.verify package, is   used to check the amount of times a method is invoked.   Add in the ATest class a test...
asked by 01.04.2018 / 05:23
1
answer

Converting String in ArrayList

I am getting in my java code a variable with the following value String arquivo = "CNPJ;INSCRICAOESTADUAL;COD_IBGE;DT_OPE;VLR_CARTAO_CRED;VLR_CARTAO_DEB 35083840049;0;4312476;13/01/2018;0.00;66.00 35083840049;0;4312476;18/01/2018;33.00;26.00 3...
asked by 24.05.2018 / 19:53
2
answers

Which method to get the full volume of media on Android?

My application needs the user to choose at startup whether they want to hear the sounds of the app or not, as it is an application to also be used in the classroom and in that environment the volume of the app must be zeroed. > So I created a...
asked by 31.01.2017 / 16:37
2
answers

Is it possible to limit the amount of rows of a class attribute that is a list via JPQL?

I have the following query in JPQL FROM User u INNER JOIN FETCH u.enderecos e WHERE u.id =:id ORDER BY e.id DESC A user can have more than ten addresses, so we want to bring only ten addresses and if the user wants, he loads ten times. I...
asked by 25.08.2014 / 19:58
1
answer

Size of a Java String + Hibernate

Is there any way to persist a string with no size limit for the bank using hibernate? If I map my class and not limit the field, hibernate automatically creates a 255-character limit. I could give a larger limit, but ideally the field would h...
asked by 19.09.2014 / 22:24
3
answers

How to create a top numeric bar on the Android keyboard

Does anyone know how to create in the XML of an EditText that numeric bar on the keyboard?     
asked by 02.01.2017 / 12:33
1
answer

What are Crosscuting contracts? What is the relationship with Design by contract?

What are crosscuting contracts ? What is the relationship with Design by contract ?     
asked by 09.12.2016 / 07:03
1
answer

How to map two equal entities with Hibernate

I have a scenario where I have the entities Pedido and Usuário . The Pedido is composed of some attributes, among them the requestor that is mapped as follows: @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "usuario...
asked by 13.12.2016 / 13:20
1
answer

Capture words with accent with Scanner

I'm using a Scanner, in Java, to capture Words / Phrases; however when I type a word that contains accented or 'ç', the letter becomes a 'square'!     
asked by 15.04.2015 / 00:24
1
answer

High memory consumption Swing Java application

I'm developing a Java application, but when I run some tests, I noticed that when I run the application, my memory consumption increases. And according to usage, it always allocates more and more memory. It does not happen to drop the memory use...
asked by 14.04.2015 / 21:08