Обсуждение: Check constraint metadata

Поиск
Список
Период
Сортировка

Check constraint metadata

От
Roy Smith
Дата:
Hi all

I've written an ant task which reverse engineers a postgresql database
into JPA Annotated Entity classes for Hibernate/TopLink etc. So far so good.

For my next trick I want to reverse engineer null/not null and check
constraints into Spring Validator classes so I can do validation in the
web tier (and potentially as downloaded JavaScript in the browser). The
reason I want to have validation based on check constraints is that the
database will potentially be updated from other legacy applications.

I can't see any custom extensions to extract check constraints - are
there any?

If I'm barking up the wrong tree, or if there is a better approach
please feel free.

many thankis
Roy





Re: Check constraint metadata

От
Kris Jurka
Дата:

On Sat, 5 Jan 2008, Roy Smith wrote:

> I can't see any custom extensions to extract check constraints - are there
> any?
>

No, currently there's no way of retrieving this information from the
driver.  I'm not sure how beneficial it would be because it's a
relatively simple query and the hard part is actually converting the check
to Java code.  What do you do with "CHECK (f(a) = 3)" ?

Kris Jurka