Hm, I think the reason here is that productId is null when you save  
the Image. Is that correct?

The ordinal manager needs numeric values that serve as a restriction,  
it can't work with null. I should add an additional check for this to  
throw the correct exception.

On 10 Jul 2007, at 19:35, Coat wrote:

>
> Hello,
>
> In my bean's MetaData, I have the following constraint:
>
> addConstraint(new ConstrainedProperty("sortOrder")
>                    .editable(false)
>                    .ordinal(true, "productId"));
>
> The actual type of productId in the bean is Integer, however when
> using the ContentQueryManager to save a new bean, I get the following
> exception:
>
> com 
> .uwyn.rife.cmf.dam.exceptions.InvalidOrdinalRestrictionTypeException:
> The property 'sortOrder' of bean 'com.sxorch.model.Image' declares
> itself as being a restricted ordinal, but the restriction property
> 'productId' is not a number.
>       at com.uwyn.rife.cmf.dam.ContentQueryManager
> $1.useTransaction(ContentQueryManager.java:468)
>       at com.uwyn.rife.cmf.dam.ContentQueryManager
> $1.useTransaction(ContentQueryManager.java:422)
>       at
> com 
> .uwyn.rife.database.DbQueryManager.inTransaction(DbQueryManager.java:
> 2784)
>       at
> com 
> .uwyn.rife.cmf.dam.ContentQueryManager.save(ContentQueryManager.java:
> 421)
>       at com.uwyn.rife.crud.elements.admin.Add.saveAddedEntity(Add.java:
> 153)
>       at com.uwyn.rife.crud.elements.admin.Add.handleSubmission(Add.java:
> 88)
>       at com.uwyn.rife.crud.elements.admin.Add.processElement(Add.java:38)
>       at
> com 
> .uwyn.rife.engine.ElementContext.processContext(ElementContext.java:
> 460)
>       at com.uwyn.rife.engine.RequestState.service(RequestState.java:368)
>       at com.uwyn.rife.engine.Gate.handleRequest(Gate.java:187)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at
> sun 
> .reflect 
> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 39)
>       at
> sun 
> .reflect 
> .DelegatingMethodAccessorImpl 
> .invoke(DelegatingMethodAccessorImpl.java:
> 25)
>       at java.lang.reflect.Method.invoke(Method.java:585)
>       at com.uwyn.rife.servlet.RifeFilter.doFilter(RifeFilter.java:162)
>
>
> >

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

Reply via email to