Home » Author Archives: Hebert Coelho (page 2)

Author Archives: Hebert Coelho

Senior Java Development, with 4 certifications and a published book about JSF (portuguese only). Founder of the blog uaiHebert.com visited from more than 170 different countries.

Test JPQL / HQL without a deploy

jboss-hibernate-logo

Have you ever wanted to test your JPQL / HQL without doing a full deploy of your application? What we will see here today is simple solution that works for any JPA implementation: Hibernate, OpenJPA, EclipseLink and others. The base source code found in this post came from this book: “Pro JPA 2: Mastering the Java™ Persistence API – Mike ...

Read More »

Full Web Application Tomcat JSF Primefaces JPA Hibernate – Part 3

primefaces-logo

Primefaces AutoComplete, JSF Converter This post continues from part 1 and part 2. The JSF has the Converter tool that helps us get some data from the user view and transform into an object loaded from the database or a cache.           In the “com.converter” package create the following class: package com.converter; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; ...

Read More »

Full Web Application Tomcat JSF Primefaces JPA Hibernate – Part 2

primefaces-logo

ManagedBeans This post continues from part 1 of this tutorial. In the “com.mb” package you will need to create the classes bellow:             package com.mb; import org.primefaces.context.RequestContext; import com.util.JSFMessageUtil; public class AbstractMB { private static final String KEEP_DIALOG_OPENED = 'KEEP_DIALOG_OPENED'; public AbstractMB() { super(); } protected void displayErrorMessageToUser(String message) { JSFMessageUtil messageUtil = new JSFMessageUtil(); messageUtil.sendErrorMessageToUser(message); ...

Read More »

Demeter Law

java-logo

Hello, how are you? Let us talk today about the Demeter Law. It is a pattern of Object Orientation that helps us to lower our coupling, decrease our maintenance impact and the raise adaptability of our systems. What is utility for those “weird” words? If you have to do any maintenance in your application, it will have a lesser impact; ...

Read More »

Full WebApplication JSF EJB JPA JAAS – Part 1

jsf-logo

This post will be the biggest so far in my blog! We will see a full web application. It will be done will the newest technologies (until today), but I will give some hints to show how to adapt this post to older technologies. In the end of this post you will find the source code to download. You can ...

Read More »

Full WebApplication JSF EJB JPA JAAS – Part 2

jsf-logo

View – Creation and JSF set up This tutorial continues from part 1. Let us create a new Dynamic Web Project. Create it like the image bellow: Pay attention: in some moment the Eclipse will ask you if you want to add the JSF Capabilities (auto complete), enable it. Like the screens bellow: After the project creation, let us edit ...

Read More »

Lazy JSF Primefaces Datatable Pagination – Part 2

primefaces-logo

The page code is very simple and there is no complication. Check the “index.xhtml” code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"> <h:head> </h:head> <h:body> <f:view> <h:form> <p:dataTable id="lazyDataTable" value="#{playerMB.allPlayers}" var="player" paginator="true" rows="10" selection="#{playerMB.player}" selectionMode="single" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15" style="width: 80%;margin-left: 10%;margin-right: 10%;"> <p:ajax event="rowSelect" update=":playerDialogForm" oncomplete="playerDetails.show()" /> <p:column> ...

Read More »

Lazy JSF Primefaces Datatable Pagination – Part 1

primefaces-logo

Today we will do JSF datatable pagination with a Lazy List with a view scoped managed bean. What all those words/expressions mean? There are several JSF frameworks today that provide datatables with a ready pagination, columns sorter and others functionalities. Today we will use the Primefaces datatable. Usually the datatables will put the displayed List, with the entities, inside the ...

Read More »

Covering your tests with Cobertura, JUnit, HSQLDB, JPA

hypersql-logo

Hello, how are you? Let us talk today about a very useful tool named “Cobertura”. This framework has the same functions of the Emma framework that we saw in another post. The major difference between Cobertura and Emma is that Cobertura displays the resume page with graphics. If you want to see the other topics about this subject click on ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close