Q:

Is it bad practice to use entity objects across all layers of a web application?

I am developing a web application using a layered architecture. I have:

Application Layer (Controllers)
Service Layer (Services)
Data Access Layer (DAOs)

which connects to a backend Oracle database.
I am using JPA with Hibernate as the implementation. I therefore create entities to model the object view of my relational database tables. 
My question is... Is it considered bad practice to use these entities objects across all 3 of my layers? 
I know it needs to be used by Data Access layer at least but what about beyond that into the Service & Application layers?
I have seen some people use DTOs in the service & application layers instead and they do conversion between DTOs and entities between the Service & Data Access layers.
Just wondering what is best practice for this and what should be the best approach?

A:

There are cases when data objects match exactly the objects that the user manipulates on the screen. On the other hand, there are cases when the user works on objects which is derived and/or affecting multiple according to a business logic. Many reporting applications are examples of the latter. 
Depending on your domain and user profile the frequency of matching data/UI objects cases are high or low. You should define separate models when needed and comes the cost of maintaining them through changes in your project. Thus, excessively separated models are bad practice. On the other hand, if you insist on passing data models everywhere, your business logic or UI code might not be very clean.
The decision to separate data access layer objects and those passed to the user interface also depends on the tools one is using. For example, in cases where controllers serialise into JSON in a static way(*) one might choose defining classes for each different tree traversal (to be used) of the object graph. On the other hand, the same objects might be usable with a JSP-based UI.
(*) An example is jackson, which uses annotations fixing the way the object (graph) is serialised into a tree. There exists means to limit the tree -useful for preventing unwanted data leaks- however their practicality and maintainability is limited, in cases I encountered.

A:

You should never use your entity objects in all layer. By using the same object in all layer your doing the tight coupling between your UI form data and database tables.
If you want to change field name on the UI, then you need to modify the corresponding column in your table. Hence it is advised to DTOs, VOs to carry the data from DAO to your front end. Use different types of mappers available in the market. One of the example is orika mapper.

