We have many entities in our system with similar names. When I use the hibernate plugin to generate an initial schema (using the diffDatabaseToChangeLog command) I get duplicate constraint names. For instance, given entities ChargeHeader and ChargeHeaderSent I get this:
<changeSet author="foobar(generated)" id="1404858920815-630">
<addPrimaryKey columnNames="id" constraintName="CHARGE_HEADERPK" tableName="CHARGE_HEADER"/>
</changeSet>
<changeSet author="foobar(generated)" id="1404858920815-631">
<addPrimaryKey columnNames="id" constraintName="CHARGE_HEADERPK" tableName="CHARGE_HEADER_SENT"/>
</changeSet>
Obviously this fails when I try to update the database with these changesets (ORA-02264: name already used by an existing constraint). I also wonder why there is no flag for the column tag that would indicate which column is a primary key, rather than having all these addPrimaryKey tags. That would avoid this duplicate name problem entirely.
Thanks,
Larry Kline
<changeSet author="foobar(generated)" id="1404858920815-630">
<addPrimaryKey columnNames="id" constraintName="CHARGE_HEADERPK" tableName="CHARGE_HEADER"/>
</changeSet>
<changeSet author="foobar(generated)" id="1404858920815-631">
<addPrimaryKey columnNames="id" constraintName="CHARGE_HEADERPK" tableName="CHARGE_HEADER_SENT"/>
</changeSet>
Obviously this fails when I try to update the database with these changesets (ORA-02264: name already used by an existing constraint). I also wonder why there is no flag for the column tag that would indicate which column is a primary key, rather than having all these addPrimaryKey tags. That would avoid this duplicate name problem entirely.
Thanks,
Larry Kline