Questions tagged as 'java'

1
answer

EJB Project Division

I have an EJB project, to do the system deployment the project needs to be divided into 3. The Database on a machine The user interface on another host And EJB (Services) in another Only the system is fully developed in ejb, the EAR p...
asked by 11.06.2015 / 17:09
2
answers

In Java would I have as a variable to receive a function as in JavaScript?

Example: var x = function (a, b) { return a * b }; Would you like it? Or is it a JavaScript feature?     
asked by 21.08.2018 / 17:46
1
answer

How to prevent the List.size () method from executing lazyload with Hibernate and JPA

When I make a query in the database and an object is returned, that object has a collection, which by default is Lazyload, if I do object.getColecao().size() it runs the lazyload to bring the records, whether the session or the entitymanag...
asked by 04.02.2014 / 23:13
1
answer

Software to obfuscate APK

I do not know this question is valid to raise here according to the policies of questions but if not I will remove it, a brief search on the internet found several tools including websites that decompile an apk decompileandroid android-...
asked by 28.07.2014 / 15:06
2
answers

Mock of static method with Demoiselle and PowerMock / Mockito

I'm trying to mock a static method, but PowerMock requires the use of a specific Runner (PowerMockRunner) for mock static to work! And for Demoiselle to work you have to start Weld with DemoiselleRunner, but the JUnit API only accepts a singl...
asked by 11.02.2014 / 14:34
1
answer

Error adding value in array, repeated values

I have two arrays, A and B. I have created 3 functions in which I take a value from the beginning of array A and array B, remove the values, compare the values and if the value of A is greater than B, I add the 2 values at the end of array A,...
asked by 23.03.2018 / 21:59
1
answer

Efficient data structure for competing problem of high scores

As part of a test I was asked to develop an application to manage high-score data in highly competitive environments. This application should not persist on disk or use libraries and external frameworks . Basically the requirements say: Opt...
asked by 23.12.2013 / 14:35
1
answer

How to take the refresh of the whole page when using the FileUpload component of the firstfaces

I'm using the FileUpload component of primefaces in mode="simple" and it works fine. But when I click the save button on a particular folder, it refreshes the entire page. Can you take it? Below is my XHTML code: <h:form e...
asked by 15.04.2015 / 18:54
1
answer

How to implement a "one to zero" mapping?

The scenario is as follows: A user can have many or no comments on bulletins published on a system - obviously, a comment belongs to a single user. The problem is that Hibernate has no annotations of type @OneToZero or something simila...
asked by 12.05.2015 / 19:24
1
answer

Threads in Java

I have a multi-threaded system in Java that uses the ThreadGroup class that is deprecated. With my current implementation I also can not "kill" a thread in lock. How to implement efficient code to control Thread in Java? I ne...
asked by 13.03.2015 / 19:11