Ok so I tried a few things, starting with Robert's. I'll then come to the errors I'm now getting but before that, I wanted to make sure I got the types of my fields correct.
I first created a separate JPA project (in Eclipse), created an Entity from Tables and selected my view. The only changes were on the dates (changed to TemporalType.Date and 2 of the ints which became BigDecimal.
In my controller, I then do:
public static void index(){
List<MyModel> models = MyModel.findAll();
//use renderArgs to add the models and then display
.....
}
I then start play:
16:16:06,978 WARN ~ SQL Error: 1702, SQLState: 42000
16:16:06,978 ERROR ~ ORA-01702: a view is not appropriate here
16:16:06,979 ERROR ~ could not complete schema update
org.hibernate.exception.SQLGrammarException: could not get table metadata: MYVIEWNAME
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:128)
at org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:1030)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:187)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:386)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:892)
at play.db.jpa.JPAPlugin.onApplicationStart(JPAPlugin.java:225)
at play.Play.start(Play.java:426)
I also notice this: Caused by: java.sql.SQLException: ORA-01702: a view is not appropriate here
Then, when I try to access the page where I want to display the result:
NoSuchFieldError occured : NONE
play.exceptions.JavaExecutionException: NONE
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:285)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.NoSuchFieldError: NONE
at org.hibernate.ejb.QueryImpl.<init>(QueryImpl.java:604)
at org.hibernate.ejb.QueryImpl.<init>(QueryImpl.java:79)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:268)
at play.db.jpa.JPQL.findAll(JPQL.java:30)
at models.MyModel.findAll(MyModel.java)
The error highlighted in the browser is this:
List<MyModel> models = MyModel.findAll();
Please advise.