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

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to