3

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.

1 Answer 1

2

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>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.