views:

185

answers:

1

Q1> In spring-roo how can I define a field that I want to appear on the page but doesn't get persisted in the DB.

For e.g: If I have a confirm-password field that I want to appear on the page so that I can validation the password but don't want to persist it.

Q2> Is there a way to define a password field directly form roo shell.

A: 

Q1: Mark the field with @Transient. This is really a JPA question more than a Roo question.

Q2: You can define the field in the roo shell, but I don't believe there is a transient option in the Roo shell. You have to Mark the field with the @Transient option after you generate it with the roo shell.

BTW Roo rocks.

Rick Hightower
There is a way to define transient field through roo shell it attaches a transient key word, which skips the creation of field on the page too. I know what transient annotation does, well i'll try to explicitly place transient annotation and see if roo removes the field from the page or not.
Hussain