PRATHAP S
PRATHAP S

Reputation: 775

How to set column size in Hibernate without using Annotations

As mentioned I need to set the size of the column in Hibernate , default for String it takes varchar(255) While creating the table,

I need to make it as varchar(8000) on the time of table creation.

I've already found couple of answers using 'Annotations'- like

But is there any other way to do the same without using 'Annotations'

Thank You.

Upvotes: 1

Views: 1828

Answers (1)

Matt
Matt

Reputation: 3353

When you say 'not using annotations', I assume you are using hibernate xml mapping files? I believe in the xml mapping files, you can map a column with a length, something like:

<property name="mycolumn" column="mycolumn" type="java.lang.String" length="8000" />

Upvotes: 3

Related Questions