ORM collection where condition using base class

Bit of a long shot here, but lets give it a go.

I have a couple of entities that look something like this

CustomerUser
extends User
extends SoftDeleteEntity (mappedsuperclass=true)

Customer
has-many CustomerUser

in the collection mapping from Customer to CustomerUser i need to include
where=“Deleted = 0” however the generated sql is incorrect, trying to find
the Deleted column in the CustomerUser table not the base User table.

In hibernate i could do something like

@Filter(name=“NotDeletedUsers”, condition="{u}.Deleted=0", aliases=
{@SqlFragmentAlias(alias=“u”, table=“User”)})

Is there anyway I can do anything similar in Lucee’s ORM ?

Cheers, Chris

Chris can you give me your component declarations with the primary
properties so I can test this as you have it. I have a similar use case,
but entity inheritance has buggy corner cases in my experience.On Wednesday, February 10, 2016 at 10:20:47 AM UTC-5, Chris Blackwell wrote:

Bit of a long shot here, but lets give it a go.

I have a couple of entities that look something like this

CustomerUser
extends User
extends SoftDeleteEntity (mappedsuperclass=true)

Customer
has-many CustomerUser

in the collection mapping from Customer to CustomerUser i need to include
where=“Deleted = 0” however the generated sql is incorrect, trying to find
the Deleted column in the CustomerUser table not the base User table.

In hibernate i could do something like

@Filter(name=“NotDeletedUsers”, condition="{u}.Deleted=0", aliases=
{@SqlFragmentAlias(alias=“u”, table=“User”)})

Is there anyway I can do anything similar in Lucee’s ORM ?

Cheers, Chris