eclipse给hibernate配置文件提示
比如说<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@127.0.0.1:1521:orcl</property>
<property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="connection.username">aaaaaa</property>
<property name="connection.password">aaaaaa</property>
<property name="show_sql">true</property>
        <property name="hibernate.format_sql">true</property>
        <property name="hibernate.current_session_context_class">thread</property>
<mapping resource="com/xx/po/Persen.hbm.xml"/>
</session-factory>
</hibernate-configuration>在<property name="connection这里按alt+/就不能给提示了!直接提示为没有什么什么的
其他的标签我已经能提示了就是它的参数提示不了!每次就得去看文档觉得挺麻烦的!
myeclipse就能提示!

解决方案 »

  1.   

    能提示那是因为是myeclipse,不能提示那是因为是eclipse。eclipse系列对xml的支持很弱的,基本上无支持,当然如果你配置了xml的相关xsd或者dtd的话,那可能要好一点。相应配置在eclipse中的有关于xml configuration中。
      

  2.   

    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
            "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
            "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
        <session-factory>
            <property name="connection.driver_class">oracle.jdbc.OracleDriver</property>
            <property name="connection.url">jdbc:oracle:thin:@127.0.0.1:1521:orcl</property>
            <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
            <property name="connection.username">aaaaaa</property>
            <property name="connection.password">aaaaaa</property>
            <property name="show_sql">true</property>
            <property name="hibernate.format_sql">true</property>
            <property name="hibernate.current_session_context_class">thread</property>
            <mapping resource="com/xx/po/Persen.hbm.xml"/>
        </session-factory>
    </hibernate-configuration>
    在<property name="connection这里按alt+/就不能给提示了!直接提示为没有什么什么的
    其他的标签我已经能提示了就是它的参数提示不了!每次就得去看文档觉得挺麻烦的!
    myeclipse就能提示!