users
[Top] [All Lists]

Re: [cinjug-users] hibernate and max field lengths

To: "Arnett, Matt" <Matt.Arnett@xxxxxxxxxx>
Subject: Re: [cinjug-users] hibernate and max field lengths
From: Brian Bonner <brian.bonner@xxxxxxxxxxxx>
Date: Fri, 29 Jul 2005 16:24:30 -0400
Cc: users@xxxxxxxxxx
Delivered-to: mailing list users@cinjug.org
In-reply-to: <AB75441401112747806E7AC8A7E87D7F0303A001@c092ex02.na.cintas.com>
Mailing-list: contact users-help@cinjug.org; run by ezmlm
References: <AB75441401112747806E7AC8A7E87D7F0303A001@c092ex02.na.cintas.com>
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
Hi Matt,

Is this NPE being thrown from Hibernate? (A stack trace would clarify this). I'm surprised that your db isn't throwing a different exception than an NPE. Nevertheless, I haven't seen an automatic way to do this (i.e. built into Hibernate).

I think users would be surprised if they entered in a bunch of data into an field that the Application didn't truncate only to have the data truncated in the datastore and returned back to the user incomplete. Maybe you're thinking of a different use case.

Brian



Arnett, Matt wrote:

Is there a way to have hibernate automatically trim field lengths that exceed the maximum as dictated by the database? If you try to persist a field that exceeds a maximum length you get a very helpful java.lang.NullPointerException.

Thanks,
-Matt




This e-mail transmission contains information that is intended to be confidential and privileged. If you receive this e-mail and you are not a named addressee you are hereby notified that you are not authorized to read, print, retain, copy or disseminate this communication without the consent of the sender and that doing so is prohibited and may be unlawful. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please delete and otherwise erase it and any attachments from your computer system. Your assistance in correcting this error is appreciated.


<Prev in Thread] Current Thread [Next in Thread>