> >>>> I use hibernate tools to create classes to store my db tables.
> >>>> I have a problem with strings. I need to trim values but I want to do
[quoted text clipped - 26 lines]
>
> robert
>>>>>> I use hibernate tools to create classes to store my db tables.
>>>>>> I have a problem with strings. I need to trim values but I want to do
[quoted text clipped - 23 lines]
> I work on a big project on a db with more than 40 tables and
> distributed on many clients... changing the db is not a solution.
Adding a view doesn't really hurt.
> The best solution right now is to wrap java String in TrimString and
> using this class instead of Strings... but the "tablename.hbm.xml"
> file is automatically generated mapping db "char" into java String.
> Can I map automatically "char" into TrimString?
Maybe. You would have to hack hibernate or dialects I presume.
Regards
robert
DM - 29 Mar 2007 16:22 GMT
> >>>>>> I use hibernate tools to create classes to store my db tables.
> >>>>>> I have a problem with strings. I need to trim values but I want to do
[quoted text clipped - 36 lines]
>
> robert
I've found... on hibernate.org / Hibernate Users Faq / Tips and Tricks
How can I trim spaces from String data persisted to a CHAR column?
Use a UserType.
...doh... :-)
DM