I used Roo to create the rules and actions entities, and setup a MANY TO MANY relationship. That worked great. Not seeing any way to create the View Entity in Roo, I used Toad to create the view...
Then I used...
CREATE VIEW RuleActionsView AS
SELECT r.id as rid, r.rule_description, r.rule_name, r.version as rversion,
r.related_application, r.related_event, r.rule_type,
a.id as aid, a.action_attachment_file_name, a.action_attachment_file_path,
a.action_description, a.action_name, a.action_script, a.attachment_type,
a.builder_widgetswcpath, a.version as aversion FROM rules r, actions a, rules_related_actions rr
WHERE rr.related_actions = a.id and rr.rules = r.id;
And that did great too....at least it crawled the schema and created all the entities including the Ruleactionsview and its classes and aspects...
roo> database reverse engineer --schema no-schema-required --package ~.model --testAutomatically false --enableViews true --includeNonPortableAttributes false
Feeling oh so confident, I did a controller all and tried to run it...
Since this test was more about how to create a finder against that view, I didn't try to debug the above and include it FYI.
2011-05-31 07:44:36,366 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in file [C:\Users\user\Documents\workspace-sts-2.6.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\DBRETest3\WEB-INF\classes\META-INF\spring\applicationContext.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [C:\Users\user\Documents\workspace-sts-2.6.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\DBRETest3\WEB-INF\classes\META-INF\spring\applicationContext.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
Trying to create a finder for the Ruleactionsview entity that DBRE generated, I did...
and both returned zero, nada, zip, nothing. But...
~.model.Ruleactionsview roo> finder list --class com.corenttech.roo.dbretest.model.Ruleactionsview --depth 2
~.model.Ruleactionsview roo> finder list --class com.corenttech.roo.dbretest.model.Ruleactionsview
...worked fine, so it isn't about a DBRE generated entity, just the view entity.
~.model.Ruleactionsview roo> finder list --class com.corenttech.roo.dbretest.model.Rules --depth 2
So, Unless someone has a suggestion to achieve a Roo based finder, I will have to code one up manually. BTW the reason I want a Roo based finder, is that I have MANY such views and the whole reason to use Roo is to get best practices and standards automagically and hand coding is so passe.