<property name="generateDdl" value="true" />时,报表或视图不存在

基于jpa作为持久层,开发项目的时候,在bean.xml的文件中的数据源配置中设置了

<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="jpaVendorAdapter">
			<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
				<property name="database" value="ORACLE" />
				<property name="showSql" value="true" />
				<property name="generateDdl" value="true" />
			</bean>
		</property>
	</bean>

 一般情况下,会在项目启动的过程中,自动检查注解的实体和数据表,如果数据库不存在的标,会根据实体自动生成,但是,今天,遇到了一个奇怪的一个问题,表始终 没有生成,因此,在其他表应用本来须要生成的表的时候,总是报表或视图找不到的错如:

 

2011-05-06 09:45:56 [org.hibernate.tool.hbm2ddl.SchemaUpdate]-[ERROR] Unsuccessful: alter table r_role_x_menu add constraint FK474DC862E1A553E2 foreign key (menu_id) references p_menu 
2011-05-06 09:45:56 [org.hibernate.tool.hbm2ddl.SchemaUpdate]-[ERROR] ORA-00942: 表或视图不存在 

 

 

解决方案:

 

查看其他的同一表空间的其他用户下是否有相同的的表,如果存在,有的话删除即可,其实避免这种情况的根本方法是,给Oracle用户都指定一个自定义的表空间,不要使用Users表空间。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
为以下代码注释:<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ChangeListManager"> <list default="true" id="0fdc712c-b442-48b5-b5ec-72c0e9b163ca" name="Default Changelist" comment="" /> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="LAST_RESOLUTION" value="IGNORE" /> </component> <component name="ProjectId" id="2QVuimGepuP2YY8QMsZ0qPrP6Yt" /> <component name="ProjectViewState"> <option name="hideEmptyMiddlePackages" value="true" /> <option name="showLibraryContents" value="true" /> </component> <component name="PropertiesComponent"> <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="WebServerToolWindowFactoryState" value="false" /> <property name="aspect.path.notification.shown" value="true" /> <property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="settings.editor.selected.configurable" value="preferences.lookFeel" /> </component> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="TaskManager"> <task active="true" id="Default" summary="Default task"> <changelist id="0fdc712c-b442-48b5-b5ec-72c0e9b163ca" name="Default Changelist" comment="" /> <created>1685451198775</created> <option name="number" value="Default" /> <option name="presentableId" value="Default" /> <updated>1685451198775</updated> <workItem from="1685451199972" duration="592000" /> <workItem from="1685453362061" duration="917000" /> </task> <servers /> </component> <component name="TypeScriptGeneratedFilesManager"> <option name="version" value="3" /> </component> </project>
最新发布
05-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值