user2579448
user2579448

Reputation: 29

How to save an object with jpa

If we save an object with jpa like: session.persist(student); Does this save as prepared statements? Also, does this avoid the sql injection?

Upvotes: 0

Views: 82

Answers (2)

Lau
Lau

Reputation: 31

strudent there is an entity, represent one row(with its relation to other table if any), and will generated prepared statement that will avoid sql injection because its wrapped.

Upvotes: 1

Augusto
Augusto

Reputation: 29907

Yes, Hibernate will create a prepared statement (and thus prevent SQL injection).

Upvotes: 0

Related Questions