tags:

views:

61

answers:

1

My hbm2hbmxml task is generating ids such as below

    <id name="id" type="long">
        <column name="id" />
        <generator class="assigned" />
    </id>

I'd like them all to be "native". Can I configure the Hibernate reverse engineering to do this?

Thx, Fred

A: 

Yes. You can create a custom ReverseEngineeringStrategy by extending DelegatingReverseEngineeringStrategy, override

@Override public String getTableIdentifierStrategyName(final TableIdentifier tableIdentifier) {

// Always use native identifier strategy

return "native"; }

and have HibernateToolTask refer to this class: reversestrategy="com.foo.MyReverseEngineeringStrategy"

Cheers, Kjeld

Kjeld