Web application: DAO and JPA for data layer

I'm trying to make a secure entry that prevents SQLInjection using the OWASP specification for hashing , but for the other parts of my application, I'm thinking about using JPA, but I don't know if hybrid is good, or should I just use DAO for the entire data layer and keep it consistent?

I would also like to know if using JPA and DAO causes runtime compatibility issues?

thanks

+4
source share
3 answers

This is the answer to the question of whether it makes sense to use the DAO layer when working with JPA.

How should I use EntityManager in a well-separated service layer and data access layer?

I think the same applies to any data access logic (e.g. login)

+2
source

The best way is you can use DAO to securely use input hashing. The registry of your application you can use JPA. In my project, I use Hibernate instead of JPA.

+1
source

Your DAO must be based on an interface, which means that an implementation is a choice that you can change as you wish by including a new implementation. Clients should only know about the DAO interface.

If this is correct, I do not understand your question. Your DAO is the interface; JPA will be one implementation that you choose among many. It is not either / or; this is an interface / implementation.

0
source

All Articles