Working support for simple restricted HQL DELETE -> execution!!
This commit is contained in:
parent
e6895c3d91
commit
59e4552195
|
@ -33,6 +33,7 @@ public class StandardSqlAstDeleteTranslator
|
|||
appendSql( sqlAst.getTargetTable().getTableExpression() );
|
||||
|
||||
if ( sqlAst.getRestriction() != null ) {
|
||||
appendSql( " where " );
|
||||
sqlAst.getRestriction().accept( this );
|
||||
}
|
||||
|
||||
|
|
|
@ -29,4 +29,13 @@ public class HqlDeleteExecutionTests {
|
|||
session -> session.createQuery( "delete BasicEntity" ).executeUpdate()
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleRestrictedDelete(SessionFactoryScope scope) {
|
||||
scope.inTransaction(
|
||||
session -> session.createQuery( "delete BasicEntity where data = :filter" )
|
||||
.setParameter( "filter", "abc" )
|
||||
.executeUpdate()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue