Posts by LR10 • 957 points
67 posts
-
0
votes1
answer122
viewsA: How to count how many occurrences of an attribute in a list are equal to a value? JSF
Coso, you are using JDK 8 you can use list.foreach(action). I vary a method for this. public Integer totalStatus ( List<ProdutoManutencao> lista, String status){ Integer result = 0;…
-
1
votes1
answer4499
viewsA: Java/JSTL - Table listing with c:foreach
<c:forEach var="li" items="${livros}"> <tr> <td><c:out value="${li.titulo}" /></td> <td><c:out value="${li.paginas}"/></td> <td><c:out…
-
2
votes1
answer59
viewsA: Sqlgrammarexception
How are you using JPQL ofJPA you have to put the SELECT for your JPQL. The HQL is the one who agrees to omit the SELECT. public List<Person> findByLastName(String lastName){ String jpql =…
-
0
votes1
answer126
viewsA: Image does not appear in the project
. JSF 2.x graphicImage In the JSF 2.0, you can render the image above through the concept of "resource library". <h:commandLink> <h:graphicImage library="img" name="pdf.png"/>…
-
0
votes1
answer48
viewsA: Error while listing data in Datatable
@Override public List<UploadFiles> getListPlanilha() throws Exception { List<UploadFiles> lista = new ArrayList<>(); Criteria crit =…
-
1
votes1
answer72
viewsA: Error executing JSF project
The Hibernate XML configuration file " hibernate.cfg.xml" is always placed at the root of your classpath , out of any package. If you put this configuration file in a different directory, you may…
-
0
votes2
answers505
viewsA: Wildfly 11 cast error with Dom4j
I’ve been through this error add the scope to your dependências and the problem will be solved! <dependency> <groupId>org.hibernate</groupId>…
-
1
votes2
answers46
viewsA: Binary Replication with Java
Data Type and Java-to-Java Type Mappings SQL and PL/SQL Data Type Oracle Mapping JDBC Mapping RAW, LONG RAW oracle.sql.RAW byte[] Try to map it to byte[]. If you can java.sql.SQLException: Stream…
-
1
votes1
answer611
viewsA: Doubt in listing data from the JAVA database - JSF
<p:dataTable emptyMessage="Não existem valores para exibição" var="lista" value="#{listPlanilhas.uploadList}" paginator="true" rows="10" rowsPerPageTemplate="5, 10, 20"> <p:column…
-
0
votes1
answer47
viewsA: User-Managed Transaction and Flush problem using JTA and Arquillian
Do it like this: @Test public void delete() { class1DAO.remove(1);//deleta assertNull( class1DAO.find(Class1.class, 1) );// se null ok. }//
-
0
votes3
answers5148
viewsA: Return BD data using List/Arraylist - Java
public List<Sale> getSales (Date startDate, Date endDate ){ Conection con = //de alguma forma vc pega conexao com o banco Statement stmt = con.createStatement(); List<Sale> sales = new…
-
0
votes1
answer155
viewsA: GET instead of DELETE in the REST webservice
Your client is making a request of the kind GET changes to the request to DELETE as in the example below. I am using POSTMAN your eve URL gets more or less to yes: localhost:8080/Banco/delete/1…
-
1
votes1
answer2275
views -
0
votes2
answers40
views -
2
votes2
answers12692
viewsA: Error Creating bean with name 'entityManagerFactory' defined in class path Resource
Add the javassist dependency: <dependency> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> <version>3.20.0-GA</version>…
-
0
votes1
answer81
viewsA: Hibernate is not generating id to write to the bank
Switch this to GenerationType.AUTO: @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id") private Integer id; Take a look at Mysql if the ID is auto AUTO_INCREMENT.…
-
1
votes2
answers3493
viewsA: Difference between primitive type and object in Java
Java has two types of data that are divided by value (tipos primitivos) and by reference (tipos por referência). The primitive types are boolean, byte, char, short, int, long, float e double.…
-
0
votes2
answers743
viewsA: Three points in the parameter of a function in a class, what is it for?
Since PHP 5.6 you can also use the ...$numbers notation: As variable functions can now be implemented using ... operator, instead of relying on func_get_args () . function f($req, $opt = null,…
-
2
votes5
answers8190
viewsA: Onclick event in image
$(document).ready(function() { $('.thumbnails').click(function() { alert('teste'); // ocultaForm(); pode chamar aqui }); }); <script…
-
0
votes1
answer46
viewsA: Commandbutton does not register in SQL
Your objeto Vehicle is null: Start it in your VeiculoMB. @ManagedBean(name="veiculoMB")//caixa baixa @ViewScoped public class VeiculoBEAN { private Veiculo veiculo = new Veiculo(); ///implementação…
-
2
votes3
answers195
viewsA: Select with detailed like
select * from suatabela where seucampo like '%_OSIVAN SOUSA_%'
-
0
votes1
answer483
views -
-1
votes2
answers74
views -
2
votes2
answers1756
viewsA: Uploading files with Java
The parseRequest (Requestcontext ctx) hopes that the RequestContext is an argument, but the approved argument is an instance of HttpServletRequest Use Servletrequestcontext to create a…
-
-1
votes3
answers135
viewsA: What is the correct MVC concept to be addressed?
MVC is nothing more than a standard software architecture, separating your application into 3 layers. The layer of interação do usuário(view), the layer of manipulation of dados(model) and the…
-
1
votes2
answers323
viewsA: How to format resultset printing via System.out.println in Java?
while ( rs.next() ) { System.out.println( " ID: " + rs.getInt("id") + "\n Nome do cargo: " + rs.getString("nome") + "\n Nível do cargo: " + rs.getString("nivel") ); } Can print this way:…
-
3
votes4
answers1209
viewsA: Input type datetime error
You must use one of these types: <input type="datetime-local" name="bdaytime"> or <input type="date" name="bday" > email datetime-local…
-
1
votes1
answer92
viewsA: Manytomany Hibernate - study
Making the objects persistent The newly instantiated instances of a persistent class are considered transient by Hibernate. We can transform a transient instance into persistent by associating it to…
-
1
votes1
answer49
viewsA: report error - unknown property in class
java.lang.NoSuchMethodException do Ireport There is a property in Jrbeancollectiondatasource that shows the boolean option for empty spaces in JRXML to be read, and that is the secret just put a…
-
1
votes1
answer222
viewsA: Page Controller Pattern vs Front Controller
MVC is a general pattern. The idea is to separate three aspects (Modelo, Visão e Controle) from one application to another. Now, this idea can be realized in different ways according to the details…
-
0
votes2
answers78
viewsA: How to refer to a String through various values in Java (Android)?
Use the Class Stringbuilder https://developer.android.com/reference/java/lang/StringBuilder.html StringBuilder sb = new StringBuilder(); public void assistente(View view) { if…
-
1
votes1
answer1618
viewsA: java.lang.Classnotfoundexception: Could not load requested class : com.mysql.jdbc.Driver
mysql-connector-java-5.1.26-bin.jarbprecisa be in the runtime classpath. You need to add to mysql-connector-java-5.1.26-bin.jar to the project that is just the file . jar. Go to the eclipse and note…
-
0
votes1
answer114
views -
0
votes1
answer1061
viewsA: Capture the file creation date
Creates a method and deposed saves the information in the bank: public InformacaoArquivo verificarDataModificacao(String nomeArquivo) throws IOException { Path file = new…
-
0
votes1
answer236
viewsA: Java @Generatedvalue + SQL server NEWID + Hibernate
Add this property to my archive: <property name="hibernate.id.new_generator_mappings" value="false" /> Helping - https://hibernate.atlassian.net/browse/HHH-11014 or you can create a Quence in…
-
1
votes1
answer1505
viewsA: Insert image in Ireport
Ireport Changes the Image field type of the report to java.io.InputStream. Creates a parameter variable $P{imagem} of the kind InputStream in Ireport. JAVA: InputStream imgPath = new…
-
0
votes2
answers808
viewsA: Figure out the file format without extension
You can do yes take the file without extension and convert to one with the desired extension. public static void main(String[] args) throws IOException { String path = "C:\\Files\\Foto"; byte[]…
-
20
votes1
answer23929
viewsA: How to get the ngFor index value
<ul> <li *ngFor="let item of especialidades; let i = index"> {{i}} {{item.codigo}} </li> </ul> Angular syntax ngFor: https://coryrylan.com/blog/angular-ng-for-syntax…
-
1
votes3
answers1606
viewsA: mascara and formulary validation
Example : http://jsfiddle.net/5wkjbu8c/ HTML <form id="meuForm" action=""> <label>CPF</label> <input id="cpf" name="cpf" type="text" value="" /><br /> <input…
-
0
votes2
answers897
viewsA: Download Zip Files via blob array
var file = new Blob([response], {type: 'arraybuffer'}); var fileURL = URL.createObjectURL(file); Take a look at these answers for more details.…
-
0
votes1
answer305
viewsA: Session Hibernate errors - getCurrentSession()
Try to yes: session = sessionFactory.openSession(); session.beginTransaction();
-
0
votes4
answers152
viewsA: Using Mysql how to create a Select that searches "together" words
SELECT pessoa FROM tabela WHERE pessoa like '%jose%' or like '%da%' or like '%silva%' or SELECT pessoa FROM tabela WHERE pessoa like '%jose_da_silva%' It worked so well: select pessoa from tabela…
-
0
votes2
answers152
viewsA: Get text inside input with radiobutton input-group-addon
Based in this answer: $('input[name=radioName]:checked', '#myForm').val()…
-
0
votes3
answers779
viewsA: Print page with Background
@media print body { background-image: url('../images/cancelado.png'); } or @media screen and (min-width: 480px) { body { background-image: url('../images/cancelado.png'); } }…
-
1
votes2
answers321
views -
0
votes2
answers616
viewsA: Rollback() JPA + Hibernate
org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions ERROR: Column ‘COD_OPERACAO’ cannot be null jan 16, 2018 11:06:12 AM Code operation cannot be null see this and run again!! catch…
-
0
votes2
answers800
viewsA: Problem when mapping Servlet in web xml
Try so : <servlet> <servlet-name>addContatoServlet3</servlet-name> <servlet-class>controllers.addContatoServlet3</servlet-class> </servlet>…
-
0
votes3
answers500
viewsA: Foreign key exclusion
@NotNull @ManyToOne(optional = false,cascade=CascadeType.REMOVE) @JoinColumn(name = "pessoa_id") public Pessoa getPessoa() { return pessoa; }
-
0
votes3
answers430
viewsA: Return method in Java
public static void main(String[] args) { String codBarras = "23793.44308.90010.000041.33001.250001.3.52830000008091"; int dv = Base10(codBarras){ }
-
1
votes1
answer489
viewsA: How to run the Maven dependencies?
Goes into Run AS then in Maven Build then in Goals : or in the cmd typhoon: mvn clean install package If the error continues run these steps from the link below :How to use Mysql in Java EE?…