specifying length of binary field in hibernate-prefs.properties
"James Neville" <[email protected]> Tue, 14 Dec 2004 15:47:44 +0000
| Newsgroups | gmane.comp.java.ejb.middlegen.user |
|---|---|
| Message-ID | <[email protected]> |
Hi All,
This question's just a simple case of syntax, I hope.
In my hibernate-prefs.properties I map a bytea column to a binary type
for my hibernate mapping generation:-
------------------------------------------------------------------------------------
hibernate.tables.upload.columns.data.java-name=data
hibernate.tables.upload.columns.data.java-type=binary
hibernate.tables.upload.columns.data.length=10024
------------------------------------------------------------------------------------
I had hoped that setting something like the above '...data.length' would
suffice.
Unfortunately, on generation of the hibernate mapping xml files,
Middlegen will always produce the following:-
------------------------------------------------------------------------------------
<property name="data" type="binary" column="data" length="-1">
<meta attribute="field-description">
@hibernate.property
column="data"
length="-1"
</meta>
</property>
------------------------------------------------------------------------------------
I can replace this with an ant regex task, but some of the binary field
lengths will differ in size.
So, how do I set the length of the generated binary length attribute
*without* manually editing the hibernate mappings afterwards?
Many thanks in advance,
James.
This e-mail is confidential. If you have received it in error, you are on notice of its status. Please notify us immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person; to do so could be a breach of confidence. Thank you for your cooperation. Please contact +44 (0) 20 72037300 or email [email protected] if you need assistance.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/