Bob Morley wrote:
> 
> Will do. I seem to recall that I had to change a number of signatures  
> in the entity pkg to float down appropriate context so default would  
> not be used. I will dig up my work on Monday and compare to latest  
> ofbiz trunk.
> 

Adam -- I took a look at the changes that I had put in place and one of the
fundamental problems can be seen in EntityExpr -> makeWhereString around
line 130 "this.checkRhsType(modelEntity, null);".  The second argument there
is meant to be the delegator.  In checkRhsType it has logic to check for a
null delegator and if so "we'll cheat a little here and assume the default
delegator".  Our issue was that our default delegator database looked quite
a bit different from our "tenant" database so we would get into this code
and use the wrong delegator and as a result the wrong entity model.

We made a few changes such as ...

- change the signature chain for entity expressions to provide the delegator
- if checkRhsType is called with a null delegator we log a warning message *
- removed default constructor for GenericValue to one that required a
delegator
- throw illegal argument exception if GenericDelegator is constructed with a
null delegatorName
- creation of GenericValue and GenericPK to require a delegator rather than
an anti-pattern of construction and setDelegator pattern.

* I wonder if this should have been changed to an IllegalArgumentException
upon reflection.

I could package these changes up for your review and possible inclusion into
Ofbiz if you feel there is value in doing so ... thoughts?

PS.  I think some of my list of changes here have been covered off by your
changes.  I looked into the expression stuff in trunk, but the rest I was
just eye balling in FishEye against our svn.
-- 
View this message in context: 
http://n4.nabble.com/Seperate-tenant-entity-for-entitymodel-xml-tp1750583p1751842.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Reply via email to