Hi Jeremy,
can you please turn on SQL tracing to see which query is actually
executed to perform the validation?
You can do this by setting the config parameter SQL_DEBUG_TRACE to true.
Thanks,
Geert
On 15 Aug 2007, at 04:18, Jeremy Whitlock wrote:
>
> Hi All,
> I have a simple database configuration that looks like so:
>
> Repository
> ----------------
> ID (PK)
> CONTAINERID (FK)
> .....
>
> Container
> --------------
> ID (PK)
> .....
>
> In my RepositoryMetaData.java, I have the following constraint:
>
> .....
> addConstraint(new ConstrainedProperty("containerId")
> .notEmpty(true)
> .notNull(true)
> .manyToOne(Container.class, "id")
> );
> .....
>
> RIFE creates my tables as expected from the MetaData classes but when
> I try to validate a Repository bean, I get a ValidationError when I
> shouldn't. The Repository.getContainerId() returns an id of an
> existing container but when I do:
>
> ((Validated)repository).validate(Utils.getGenericQueryManager
> (Repository.class))
>
> I get the following (error is a ValidationError):
>
> error.getSubject() = INVALID
> error.getIdentifier() = containerId
> error.getErroneousValue() = null
>
> Now...I know that there is a valid containerId set in my Repository
> bean but RIFE continues to tell me that the containerId is invalid.
> If my understanding is correct, if I have a Container row with an id
> of 0 and my Repository bean has a containerId of 0, it should be
> valid. Can someone see some error in my logic? All I want to do is
> store the id of a Container object in my Repository object and
> validate properly. Based on my POJOs and the MetaData for the POJOs,
> I do not see where I'm going wrong.
>
> Thanks in advance,
>
> Jeremy
>
> >
--
Geert Bevin
Terracotta - http://www.terracotta.org
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"rife-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---