私はhibernateを使用するプロジェクトを設定しています。クラスを作成し、.hbm.xmlファイルを書き込まないように注釈を追加しています。私はまた、DAOやデータベース作成のための達人特別hbm2daoプラグインHibernate3のとhbm2ddlを使用しようとしていますが、私はエラーはmavenプラグインでhibernate daoとddlを生成します
failed: Unable to load class declared as <mapping class=package.ClassName.....
hibernate.cfg.xmlのは、以下の取得:プラグインの
<hibernate-configuration>
<session-factory name="jndi/composite/SessionFactory">
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.connection.autocommit">false</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.password">PASS</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/DATABASE</property>
<property name="hibernate.connection.username">USER</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory </property>
<property name="hibernate.use_sql_comments">true</property>
<mapping class="package.....models.User"/>
</session-factory>
</hibernate-configuration>
設定をon pom.xml
<configuration>
<components>
<component>
<name>hbm2dao</name>
<implementation>annotationconfiguration</implementation>
<outputDirectory>target/generated-sources/hibernate3</outputDirectory>
</component>
</components>
<componentProperties>
<jdk5>true</jdk5>
<ejb3>false</ejb3>
<packagename>package......models</packagename>
<format>true</format>
<haltonerror>true</haltonerror>
<scan-classes>true</scan-classes>
</componentProperties>
</configuration>
私が忘れているかもしれない情報は、尋ねるだけで、ありがとう。
「あなたは」として宣言されたクラスをロードできませんでしたか? –
フォーマットが正しくありませんでした。現在は表示されています。 – LoneWolf