Toseef Zafar
Toseef Zafar

Reputation: 1767

does @ModelAttribute in spring MVC have to represent an entity in Hibernate?

consider the following example:

@ModelAttribute ("personForm") PersonForm personForm

in a method, now:

  1. should this PersonForm object identicle to the Person object have created as Hibernate entity?

or

  1. PersonForm is just way to get input from form and access it in the controller? i.e. taking benefit of Spring MVC data binding.

Upvotes: 0

Views: 520

Answers (1)

Sanjay
Sanjay

Reputation: 8965

Not 1, but 2 is right. You can use a hibernate entity for convenience, but it's not a requirement.

Upvotes: 1

Related Questions