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

Ignore Hibernate @Where annotation #130

Open
Aksigera opened this issue Jul 8, 2021 · 0 comments
Open

Ignore Hibernate @Where annotation #130

Aksigera opened this issue Jul 8, 2021 · 0 comments

Comments

@Aksigera
Copy link

Aksigera commented Jul 8, 2021

Hello,

I didn't find a way of how to ignore the Hibernate's @Where annotation on Entity.

The common approach to do so is to use nativeQuery, see stackoverflow.com/a/51250675/7968539.

But I'm not sure how to apply it to DataTables.

Is there a way to do so?

This is an entity with Hibernate's @Where annotation:

@Entity
@SQLDelete(sql = "UPDATE vehicle SET deleted_at = NOW() WHERE id = ?")
@Where(clause = "deleted_at IS NULL")
public class Vehicle extends AbstractEntity implements Serializable {...}

And this is a corresponding repository extending DataTablesRepository:

@Repository
public interface VehicleDataTableRepository extends DataTablesRepository<Vehicle, Long> {
}

Again, I need to see all Vehicles in my DataTable, disregarding the deleted_at column.

Thanks!

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