hbm2javaでコメントを生成する方法pojoは?
質問
Hibernateを使用した私の現在のセットアップは、を使用します hibernate.reveng.xml
さまざまなものを生成するファイル hbm.xml
ファイル。その後、それを使用してpojosに変換されます hbm2java
. 。スキーマを設計しながら時間を費やして、テーブルとそこの列にかなりまともな説明を配置しました。これらの説明を引き出すことができます hbm.xml
それらを使用して生成するときにファイル hbm2jhbmxml
.
だから私はこれに似たものを手に入れます:
<class name="test.Person" table="PERSONS">
<comment>The comment about the PERSONS table.</comment>
<property name="firstName" type="string">
<column name="FIRST_NAME" length="100" not-null="true">
<comment>The first name of this person.</comment>
</column>
</property>
<property name="middleInitial" type="string">
<column name="MIDDLE_INITIAL" length="1">
<comment>The middle initial of this person.</comment>
</column>
</property>
<property name="lastName" type="string">
<column name="LAST_NAME" length="100">
<comment>The last name of this person.</comment>
</column>
</property>
</class>
では、どうすればわかりますか hbm2java
これらのコメントを作成して作成したJavaファイルに配置しますか?
私は読みました これ Freemarkerテンプレートを編集して、コードの生成方法を変更することについて。私はコンセプトに立ち向かいますが、事前条件とポスト条件の例を超えて、他に何ができるかについて詳しく説明するものではありませんでした。
所属していません StackOverflow