Posts by Edjane • 628 points
39 posts
-
0
votes1
answer490
viewsA: How to recover a database in Mysql
There’s a hint on this one website that can help you: First you create a new database with the tables. Then delete newly created files using the DISCARD statement ALTER TABLE newdb.table1 DISCARD…
-
0
votes1
answer51
viewsA: JPQL Order by and LIMIT (JSF and JPA)
Try doing the research this way: public Historico obterMarket() { return this.entityManager.createQuery("SELECT h FROM Historico h ORDER BY h.idhistorico DESC", Historico.class).getSingleResult(); }…
-
0
votes1
answer31
viewsA: Error while trying to list employees on the project sale screen
What’s going on is that you didn’t list employees. Look at your products are being listed, right? Because you listed them in your method new() produtos = produtoDAO.listar("descricao"); When you…
-
2
votes3
answers306
viewsA: Understanding the exercise of the book Use the Java Head
I studied a lot of exercises of this type to get OCJP certification, it covers instantiation of classes and passage of values, for example, because this line, m4.counter = m4.counter + 1; contained…
-
1
votes1
answer283
viewsA: An error occurred while performing resource injection on the state managed bean
Try to do it this way: in your class state start a class name always in capital letters; initialize its state and state variables, you can do this in the constructor method because it will always be…
-
0
votes2
answers1469
viewsA: Vertical text in table
See this example, presented in the following question: stackoverflow $(document).ready(function() { $('.rotate').css('height', $('.rotate').width()); }); td { border-collapse: collapse; border: 1px…
-
0
votes1
answer68
viewsA: How to create a relationship using JPA that contains attributes?
Yes, that’s the way. You have a Usuarioentity class right? A hint, user is already an entity,and you will persist the objects of this class in a database, for the name of your classes to be more…
-
2
votes3
answers103
viewsA: I’m not able to log data into the database
What I think is happening in your code is that you must have generated a table before with different data, which is why when analyzing the error it returns: Column 'pais_id' cannot be null But I…
-
0
votes1
answer314
viewsA: how to terminate the input when using . hasNext() in java?
Hello you can do something like this: Scanner ler = new Scanner(System.in); //seu código de entrada if (ler.equals("")) { ler.close(); } }
-
3
votes2
answers1181
viewsA: Compilation error: The literal ... of type int is out of range
The compiler is trying to parse the long value as an int type, in case you have to declare it as follows: System.out.println(c.cpfIsValid(63636363555L));
-
0
votes1
answer392
viewsA: Checking the existence of an object in an arraylist
First declares your identifier as: //objeto do tipo inteiro private Integer codigo; Then replace your equals method with: @Override public boolean equals(Object obj) { if (this == obj) return true;…
-
1
votes1
answer90
views -
3
votes1
answer136
viewsA: "The Java Exception has ocurred" error while running the Postgre JDBC driver
You are using the Java 8 drive As you are using Java 7 the compatible drive is: Postgresql JDBC 4.1 Driver, 42.2.1.jre7 //this is the latest version, if you want you can search by 42.0.0.jre7 You…
-
-3
votes2
answers275
viewsA: Find patterns within a String
Here is an example of how to separate the string into characters so you can do the exercise. With this example you can separate the dates as well. //Nesse exemplo só vou dividir os números a cada 11…
-
1
votes1
answer339
viewsQ: Recover shopping cart after close and open browser
I’m assembling a shopping cart with JSF it’s working, but not in the way I believe is correct. Example: When I enter sales sites, even if I am not logged in, I can add items to the cart, and even…
-
1
votes1
answer953
views -
1
votes1
answer68
viewsA: xmlns jsf error, settings?
The problem is on that line: <h:selectOneMenu class="form-control" id="selectOlhos" jsf:value="#{corpoController.corpo.corOlhos}"> The right thing is: <h:selectOneMenu class="form-control"…
-
1
votes1
answer194
viewsA: Comparison of if-Else not continuing even with Else in Java
When you enter the no-dispensation option Direct on the second if it exits the Else condition, then Else will not be processed, look at this example: public static void main(String[] args) { boolean…
-
2
votes2
answers273
views -
0
votes1
answer736
viewsA: Change the color of Toolbar on primefaces
When accessing your page through the browser, go on inspect element, click on the object you want to know the information and look for the tag class, in the case of Toolbar of the first faces has…
-
2
votes2
answers34
viewsA: Because '08' generates error inside the Eclipe?
The problem is that in most languages a literal integer started by zero is interpreted to be an octal value, which is why until 07 works because there is no octal representation of these numbers the…
-
2
votes1
answer816
viewsA: How to call method with the java array parameter?
By pulling the method in its main class you have to pass the necessary parameters for the method to work, these parameters also have to be reported in the method. Example: public class Principal {…
-
0
votes1
answer125
viewsA: Primefaces inputText Ajax, returns value missing the last character
I managed to solve, follow solution in case someone goes through the same problem. Turns out I was using an event method and making the call as follows: public void verificar(AjaxBehaviorEvent…
-
0
votes1
answer125
viewsQ: Primefaces inputText Ajax, returns value missing the last character
I’m having a problem using the ajax of primefaces, I also tried with the ajax of jsf. I have the following code snippet: <h:panelGroup> <p:inputText id="skuProduto" size="20" maxlength="20"…
-
1
votes1
answer117
viewsQ: JPA - There is the possibility of using Matchmode.ANYWHERE with Predicate
Usually when I need to do a search picking up a result through a single word, using Criteria and Restrictions I do as follows: criteria.add(Restrictions.ilike("nome", filtro.getNome(),…
-
1
votes1
answer116
viewsA: Doubt about how to use a screen to measure temperature by cell phone
Your doubt is much like this: https://stackoverflow.com/questions/11931681/how-to-get-device-s-temperature-in-android and that:…
-
4
votes1
answer223
viewsA: Validate only numbers
Try it this way: var valor = new RegExp('^[0-9]+$'); In that case the answer would be: s = false S10 = false 10 = true 10,0 = false For floating number is used dot if for example it was used 10.0,…
-
1
votes1
answer174
views -
0
votes1
answer29
viewsA: Update in an off-tab dialog
When a dialog in the Primefaces versions greater than 4, the call of the dialog is made differently from what you are using, I believe your problem is that. Change that command:…
-
0
votes2
answers439
viewsA: Is there a free graph-oriented database for commercial use?
Search on DB Arango, it is free and open source. https://www.arangodb.com There are many tips on how to use it here: https://www.arangodb.com/arangodb-training-center And in case you want to search…
-
0
votes1
answer656
viewsA: p:graphicImage does not display image
As I told you earlier, I replicated your situation here using Maven, primefaces 6.0 and got the same problem as you. What happens is that Graphicimage makes two HTTP requests per generated image. I…
-
1
votes1
answer372
views -
2
votes1
answer375
viewsA: Two id in table Hibernate
Can do using @Embeddedid You can do it like this: @Embeddable class ClassePrimeira implements Serializable { @Id Integer chaveUm; @Id Integer chaveDois; // get’s e set’s } @Entity public class…
-
0
votes2
answers477
viewsA: how to change the color in each selectitem of a jsf selectOneRadio
When I needed to do something like this I did it this way: I took your code as an example, to test it here, I used styleClass, but you can use only class as well <h:selectOneRadio…
-
0
votes1
answer26
viewsA: Doubt except that it does not let start a Maven project
how is your project structure? Where you put the file pom.xml? Puts the data in your file pom.xml here to make it easier to help you.
-
1
votes1
answer604
viewsQ: Search using Criteria with WHERE, AND and OR
I’m trying to do a survey using Criteria, the research would be this: SELECT * FROM lefacil.pap_produto a WHERE (a.marca='Fabber Castell' or a.marca='Tilibra') AND (a.quantidadeCores='12 Cores' or…
-
0
votes1
answer121
viewsA: I’m having trouble making a.css file.
Are you using Notepad? If yes, at the time you save the file, change the encoding to Unicode. In the case of files already created you can use the CMD to rename.
-
1
votes2
answers74
viewsA: How to edit gigantic codes?
If you have a well-documented system, no matter the size of the code it is easy to identify what each method does within a class, another thing, a documentation with well-defined requirements there…
-
0
votes1
answer453
viewsA: Update a selectOneMenu (bean method)
First you create a list looking box by company, then in your bean creates a method listerner to load this list when selecting a particular company. Kind of: public void…