我第一次尝试使用 Spring Roo 通过逆向工程生成代码。
安装 Postgresql 插件后:
osgi install --url
http://spring-roo-repository.springsource.org/release/org/springframework/roo/wrapping/org.springframework.roo.wrapping.postgresql-jdbc3/8.4.701.0001/org.springframework.roo.wrapping.postgresql-jdbc3-8.4.701.0001.jar
我尝试下一个命令:
database introspect --schema USER
我确信我的数据库中有 USER 模式(当我使用 TAB 键时,我得到 USER 以及具有正确区分大小写的其他模式名称),但 spring 响应是:
roo> database introspect --schema
USER information_schema pg_catalog
pg_toast_temp_1 public
roo> database introspect --schema USER
Schema 'USER' does not exist or does not have any tables. Note that the schema names of some databases are case-sensitive
最佳答案
我在遇到类似问题后提出了这个问题,并认为我会回答这个问题,即使这个问题已经存在一年了。
我的问题是我没有在database.url 属性中包含数据库名称。添加后,数据库自省(introspection)开始工作。
database.url=jdbc\:postgresql\://localhost\:5432/<dbname>
奇怪的是,选项卡完成功能有效并显示模式选项,给人一种数据库配置一切正常的错误印象。
关于postgresql - DBRE Spring Roo 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4980228/