1

Is these some Way to define my own mapping of hibernate to database Object?? For example, by default String maps to varchar(45), I want to change it to TEXT or just varchar(245) , what are the ways of achieving it ???

1 Answer 1

1

You can use either

<property name="description" type="string">
    <column name="description" length="100" />
</property>

in xml or

@Column(name="description", length=100)

annotation in class.

Alternatively, you can use @Type annotation - for more info see this or this.

You probably want to use @Type(type="text").

Sign up to request clarification or add additional context in comments.

1 Comment

I too searched on net ...somehow not able to reach right place ... wrong search supposigly ...your link is perfect .... thanks a ton ..

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.