Luis,

I don't know of any elegant extension point for this problem but I would try 
extending the DBDictionary you are using. You could override the 
getCreateTableSQL method. Since it takes table definition as parameter and you 
know your view names, you might decide whether to call super implementation or 
create a view. Problems may arise when OpenJPA tries to drop table/view or 
apply integrity constraints but there are methods for those also.

Regards,
Milosz


> Hi.
> 
> We use SynchronizeMappings buildSchema(ForeignKeys=true) and we still have a 
> long way in development, and we don't want to loose it's convenience, but now 
> we need to map some entities to database views.
> 
> Is there a way, perhaps a plugin or exension point, to provide custom   
> generators for specific tables, or provide the sql by hand to generate 
> specific 
> tables (however as views instead)?
> 
> --
> Luis Fernando Planella Gonzalez
> 

Reply via email to