Posts by Bruno • 656 points
41 posts
-
0
votes1
answer17
viewsA: How to define which data of an ENUM the JPA will persist in the bank?
You can use the annotation @Enumerated that has two options: EnumType.STRING - Reads and saves the value of .name() of your Enum. EnumType.ORDINAL- Reads and saves the value of .ordinal() of your…
-
0
votes1
answer22
viewsA: How to detect auto if the device is horizontal in java
You can detect the orientation of the device by overriding method onConfigurationChanged , as below: @Override public void onConfigurationChanged(Configuration newConfig) {…
-
0
votes1
answer20
viewsA: Reactor - Use orelse after a filter
Has the method switchIfEmpty that does this. Mono.just("someName") .filter(this::isMyName) .flatMap(this::delete) .switchIfEmpty(save("otherName"));…
-
0
votes1
answer66
views -
0
votes1
answer31
viewsA: How to popular only a part of the object with a query in Hibernate
You can specify the class that will be populated by the repository via projection. public interface CoursesRepository extends CrudRepository{ @Query("select new pacote.completo.CustomCourseDTO(c.id,…
-
0
votes1
answer337
viewsA: Error creating bean named 'springSecurityFilterChain'
You need to create a service that implements Userdetailsservice. For example: @Service public class MyUserDetailsService implements UserDetailsService { @Autowired private UserRepository…
-
1
votes1
answer55
views -
0
votes2
answers900
viewsA: Return JSON from API with parameter
You are not passing the url parameters to call the service. You can pass them using String.format() for example. String APP_ID = "9482c2f0ff66359309fcdb84b04f3152"; String uri =…
-
0
votes1
answer278
viewsA: How to receive a Json in a Clob Java + Spring boot Field
You can use the @Lob annotation @Lob private String detailProspectProposalText;
-
1
votes3
answers734
viewsA: How to compare Arrays?
You can use the Streams Api to filter the intersection between lists. List<Integer> collect = lista1.stream() .filter(lista2::contains) .collect(Collectors.toList());…
-
0
votes2
answers30
viewsA: Images in the Mysql BD in the java language
You can create a class with byte array property. I will illustrate a way using Spring Boot with JPA: First, we create the class that represents the model in the database. @Lob represents the type…
-
2
votes1
answer233
viewsA: Springboot with Hibernate and relationship between postgres tables in different schemas
In the Table1 class, you may need to map the schema to the Table2 class using the property "targetEntity": @OneToMany(targetEntity=Tabela2.class, mappedBy = "tabela1") private List tabela2= new…
-
0
votes1
answer399
viewsA: Doubt about the eclipse [Workspaces Master]
This symbol indicates that these files were not added to a versioning tool. If the project is not using versioning control, the folder where the project was imported may be. You can check the…
-
6
votes1
answer13343
viewsA: ANDROID_HOME Linux Environment Variable
It is necessary to rotate the commands: sudo gedit ~/.bashrc In this file you need to add the following commands: export ANDROID_HOME=caminho_do_SDK export…
-
4
votes2
answers2120
viewsA: API works in POSTMAN, but not in code
It is necessary to enable CORS on the side in the API you are wanting to use. HTTP access control (CORS)…
-
2
votes2
answers788
viewsA: How to add text + icon to the label?
Try it like this: public LabelIcone() { setSize(400, 200); setLocationRelativeTo(null); setDefaultCloseOperation(EXIT_ON_CLOSE); ImageIcon icone = new…
-
0
votes2
answers51
viewsA: I’m not getting my wicket application running
I believe that the Simplepage class needs a default constructor, as in the example below: import org.apache.wicket.protocol.http.WebApplication; public class HelloWorldApplication extends…
-
1
votes1
answer65
viewsA: Calculating Random Password using Arraylist and Resultset in Java
To get only the first letter of the name, you can use the substring method(). Ex.: for (int i = 0; i < lista.size(); i++) { CalcSenha.append(lista.lista.get(0).subString(0,0));…
-
0
votes4
answers173
viewsA: Error 404 Spring boot Ubuntu
I created a project using this pom and it worked: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"…
-
0
votes4
answers173
viewsA: Error 404 Spring boot Ubuntu
I could try to force Spring to scan the class: @ComponentScan(basePackageClasses = DemoApplication.class) Another thing, the note @Springbootapplication is in some other application class? I believe…
-
1
votes1
answer2343
viewsA: How to update the view after database change with IONIC 2
To make a page real-time you must use the timer function of an Observable to perform the refresh of the page. For example, when starting the page we should call the function responsible for…
-
2
votes2
answers970
viewsA: How to connect Virtual Android with Postgresql on Local Machine?
It is not possible to make connections from Android directly to a database. For this it is necessary to consume a web service. On this site there is an example of creating and consuming a web…
-
0
votes1
answer41
viewsA: Doubt about $ionicLoading.Hide() closure
You could call the loading Dismiss() only on the return of the service call? For example: let loading = this.loadingController.create({ content : "Loading..." }); loading.present();…
-
4
votes2
answers9742
viewsA: How to insert current date in postgresql?
You can set the default value in column creation, for example: my_date date not null default CURRENT_DATE
-
1
votes4
answers257
viewsA: Use of setters in the builder
Not because the attributes are all of the same class. Unless the set methods do something other than assign value to the attribute.
-
-1
votes2
answers3379
viewsA: Mysqli INSERT INTO Does not work
Commit is set to true? If not, possibly this is the solution to your problem. And in this case, use $mysqli->query('SET AUTOCOMMIT = 1');
-
0
votes1
answer162
viewsQ: Dialog with datatable is not displayed
I have a dialog with a dataTable, However, when you click the button that should open it, this does not happen. He also owns a dataTable within it that should have respective values the line in…
-
1
votes0
answers93
viewsQ: Xdebug waiting session eternally in eclipse?
I’m trying to debug a system made in php using Xdebug. I followed the installation instructions by uncommenting and changing Xdebug settings in php.ini: zend_extension =…
-
1
votes2
answers747
viewsQ: How to return calculations performed in Service to Activity?
I would like to send the result of a calculation back to Activity, I was trying to use a Binder as recommended, but I cannot recover this value. It would be possible to make Activity know that the…
-
0
votes1
answer189
viewsQ: How to ensure that all threads have run?
How can I guarantee that the get method of a Futuretask will only be called when all threads have already run? I have this method : for (int j = 0; j < threadNum; j++) { FutureTask<Integer>…
-
1
votes1
answer179
viewsQ: How to use Futuretask class correctly?
I’m looking to calculate the number of numbers that can be divided by a splitter with no rest in parallel. The problem is the result of the method always return to half of what it should, it seems…
-
3
votes2
answers665
viewsQ: How to send calculation performed in a Service for Activity?
I would like to perform a simple calculation on a Service and return the value to the Activity who called him. To take the value of the variables of Activity I call the getDoubleExtra(double) of…
-
4
votes2
answers90
viewsQ: Problems Embarrassingly Parallel?
I was looking for problems called "embarrassingly parallel", which are problems that there are no dependencies between tasks, which can be divided in parallel. Could you give me some suggestion of…
parallelismasked Bruno 656 -
2
votes1
answer384
viewsQ: Using classes from the java.util.Concurrent package to multiply matrices on android?
I was doing this program to multiply matrices, I saw that it correctly calculates the result, but there is no performance gain by putting more threads, often even worse performance despite running…
-
2
votes2
answers1125
viewsQ: How to differentiate inputs that have the same class?
I would like, when clicking on an input, to fill in a variable with the given value, but these inputs are created dynamically with an iterator and all inputs have the same class. You can identify…
-
1
votes1
answer227
viewsA: How to recognize each list element with Struts 2 iterator tag?
I was able to solve using this to get the value. var $this = $(this); var dataFimVigenciaPlanoVigente = $this.parent('td').find('.dataFimVigenciaPlanoVigente').val();…
-
0
votes1
answer227
viewsQ: How to recognize each list element with Struts 2 iterator tag?
I iterated through a list, adding inputs to be changed. When the field with the class dataFimVigencePlanoVigent is changed, a jquery function is called to change also in the object in java. However…
-
0
votes1
answer518
viewsQ: How to remove table row by passing your id to an object?
I would like to click the remove row button from the table, run an ajax function that would pass the row id to the java method. Page deletion works, but I’m not getting the id to delete the right…
-
0
votes2
answers1732
views -
3
votes1
answer6986
viewsQ: How to remove dynamically generated table row with Jquery?
I would like one of the automatically generated columns in the table to have a function to delete the row, but the on click is not working. How should I do it ? $(document).ready(function(){…
-
1
votes2
answers1732
views