在用elipse反向生成实体的时候,在点击刷新"refush"按钮时,它左边会出现你链接的数据库里面的所有的表,然后再选择你要的那个然后再反向生成实体就可以了。
但是当你新增表时可能会看不到那个表,这时你就会多点击刷新"refush"按钮时,但是还不会出现你要的那个表。这时就要想办法了。在elipse下面你会看到这么个配置文件,叫:hibernate-console.properties 修改它里面的内容,然后你就可以找到你想要的那个表了。
其实先去找cms-ejb.launch这个配置文件的,它里面有这样信息:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Hibernate Console launch configuration -->
<launchConfiguration type="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType">
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="cms-ejb"/>
<stringAttribute key="org.hibernate.eclipse.launch.PROPERTY_FILE" value="/cms-ejb/hibernate-console.properties"/>
<stringAttribute key="org.hibernate.eclipse.launch.CONFIGURATION_FACTORY" value="JPA"/>
</launchConfiguration>
里面会看到这样一句:<stringAttribute key="org.hibernate.eclipse.launch.PROPERTY_FILE" value="/cms-ejb/hibernate-console.properties"/>这样就找到了那个配置文件的位置了。