Nandkumar Tekale
Nandkumar Tekale

Reputation: 16158

Generating Hibernate POJO classes using ANT SCRIPT

I am generating hibernate pojo classes with annotations from existing tables using Ant Script. I am stuck with a problem. Problem is that Generated class contains

@Table(name="person", catalog="db1")
public class Person
{
//properties
//getter-setter methods
}

and I want to remove catalog="db1" while auto generation. I can remove manually catalog="db1" from code but I dont want that. How should I write ANT SCRIPT ? Please help.

Thanks in advance.

Upvotes: 3

Views: 486

Answers (1)

Avinash T.
Avinash T.

Reputation: 2349

Add following line in your hibernate.cfg.xml file

<property name="default_catalog">db1</property>

And in hibernate.reveng.xml use

<table name="person"></table>

Instead of

<table catalog="db1" name="person"></table>

Upvotes: 2

Related Questions