Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in generated mapping when using Formula and References #715

Closed
pr-okapii opened this issue Oct 23, 2024 · 1 comment
Closed

Error in generated mapping when using Formula and References #715

pr-okapii opened this issue Oct 23, 2024 · 1 comment

Comments

@pr-okapii
Copy link

pr-okapii commented Oct 23, 2024

We where trying to map a Reference with a Formula, our code looks like

mapping.References(x => x.SomeClass).Formula("(SELECT TOP 1 a.id FROM SomeClass a WHERE a.Condition IS NULL AND a.ParentId = id)");

the resulting hbm.xml is almost right, but it adds and invalid child element "column"

<many-to-one class="Assembly.SomeClass, Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="SomeClass" formula="(SELECT TOP 1 a.id FROM SomeClass a WHERE a.Condition IS NULL AND a.ParentId = id)">
  <column name="SomeClassId" />
</many-to-one>
@pr-okapii
Copy link
Author

Our mistake, an AutoMapping was adding the column

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant