I have just started evaluating the use of Cayenne for use with my PostGIS database. I found the CayenneModeler extremely easy to use in order to generate the code for my persistent classes. I thought that using the 开发者_Go百科Expression.fromString("...") would allow me to make an Expression using the PostGIS functions, but I receive a ExpressionParser error. Upon further reading, it looks like I may need a PostGIS database adapter. Does anyone know of the existence of one that can be downloaded freely or a way to get around this? Thanks so much.
looking at source, these are currently supported/shipped db adapters:
$ ls -l org/apache/cayenne/dba/ | grep ^d
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 db2
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 derby
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 frontbase
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 h2
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 hsqldb
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 ingres
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 mysql
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 openbase
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 oracle
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 postgres
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 sqlite
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 sqlserver
drwxr-xr-x 2 zeratul zeratul 4096 2010-11-11 16:15 sybase
Cayenne provides abstraction and adapters provider specific translation. So yes, you are right about needing it. You might want to extend PostgreSQL Adapter as PostGIS builds on Postgres.
If you know something about BNF, here is formal grammar of language that Expression parser recognizes.
精彩评论