conciliator
conciliator

Reputation: 6138

Non-persistent entities v.s. manual POJO + View + Controller?

I've successfully created a basic Spring Web MVC application using Roo, which I might add, was a treat! The application uses persistence (HIBERNATE + HYPERSONIC_IN_MEMORY), which is what you'd want for many POJOs.

Now, suppose I'd like to write some custom method which is to be accessed from the View-side, like end-of-day calculations or what have you. My immediate thoughts about how to implement these are either

1) Create an entity, keep it from using persistence and implement the desired method(s) for this class, rely upon MVC-scaffolding for presentation

or

2) Create the POJO + View + Controller manually

What is my best alternative? Is 1) even possible (i.e. not using persistence for entities through roo)? And if so: is it so that the .java files may be freely edited, while the .aj files are handled by Roo?

Thanks in advance!

Upvotes: 0

Views: 974

Answers (1)

Constantiner
Constantiner

Reputation: 14221

Option 1 is absolutely Ok using Roo's entity command. You can create new entity in Roo shell and then perform scaffolding without any problem. And then you can edit your *.java part without problems too. The only recommendation is to keep Roo shell running while editing.

Upvotes: 1

Related Questions