This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
We have two tables:
Association between acp_client and sborg is made by columns "fil" and "sborg". C# representation:
So Relationships on both side has assosiation resolvers, that references filds from other side. But next expression generate wrong SQL:
As you can see LightSpeed joins to entities on SB_ORGUG_V.Id = ACP_CLIENT.Sborg, but must be SB_ORGUG_V.Subj = ACP_CLIENT.Subj AND SB_ORGUG_V.Fil = ACP_CLIENT.Fil |
|
|
Sorry Im not really able to determine much about why this might be occurring other than it would seem to be a bug in , are you able to send through a small repro project which we can use to investigate this please?
|
|
|
Hello Jeremy. Eventually I have made a repro project. There is a sql-file with DDL script. Project made for Oracle DB and requires Oracle Data Access components. |
|
|
Hello Guys. Any thoughts about? |
|
|
Nothing yet as I am still looking into this issue. I will post an update once we have investigated this further.
|
|
|
Bump. Any news about problem? |
|
|
Sorry - this fell off our radar. Ive added in a fix for this now and this will be available in the next nightly build for you.
|
|
|
I have downloaded and installed version of 05 Nov 2013. But still getting those error on repro-project. Should I do any modification in my code of AssociationResolver? |
|
|
No you shouldn't need to make any modifications. Can you confirm what version of LightSpeed you have installed as we used the test case in the repro project to verify the fix here.
|
|
|
Hello Jeremy. Version of referenced Lighspeed assembly is 5.0.2609.0. Now error is different, but still exists.
whereas SQL query is quite good:
It seems for me that problem in Client model entity class, it has _sborgId field:
which is not marked as Transient. But marking it with Transient attribute tends LightSpeed to make wrong SQL query. |
|
|
Marking a field as transient means that the field is not considered by LightSpeed for materialisation or persistence, so that is definitely not appropriate here. The exception you are seeing would seem to indicate you have less fields being returned than is expected by the mapping, is your model in sync with the database schema?
|
|
|
Hello Jeremy, I have eventually tangled. The table scheme in DB is:
whereas model looks like:
As I can see the only difference is _sborgId field in model and it is intended for organize relationship with second table. SQL query, that cause exception specified in my previous post... Konstantin |
|
|
Bump. |
|
|
Sorry I didn't realise there was still an issue here - did you check that your model and database are in sync via the designer? If so can you send us an updated repro case when can have a look at.
|
|
|
Hello. After digging into problem again, I have found out that last problem was connected with having both ValueObject field "sborgId" of type SborgId (which has two properties Subj and Fil) and two fields "fil" and "_subj", which also referenced to the same columns in table (Subj and Fil). So, I suppose that normal solution is just to remove "fil" and "subj" fields definition from entity leaving only ValueObject "_sborgId". |
|
|
Yes thats right, you only need these to be declared as part of the composite key value object unless either the field definitions or the value object is re-aliasing the column name somewhere which allows them to co-exist.
|
|