Skip to content

Commit

Permalink
Add another quoting test with the string literal directly in the quer…
Browse files Browse the repository at this point in the history
…y rather than a parameter.
  • Loading branch information
vnayar committed Nov 7, 2024
1 parent ae8ca7e commit 47008ee
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hdtest/source/generaltest.d
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,14 @@ class GeneralTest : HibernateTest {
a1.name = "Bucky O'Hare";
int id = sess.save(a1).get!int;

auto query = sess.createQuery("FROM Asset WHERE name=:Name").setParameter("Name", "Bucky O'Hare").list!Asset;
assert(query.length == 1);
auto result = sess.createQuery("FROM Asset WHERE name=:Name")
.setParameter("Name", "Bucky O'Hare")
.list!Asset();
assert(result.length == 1);

result = sess.createQuery("FROM Asset WHERE name='Bucky O''Hare'")
.list!Asset();
assert(result.length == 1);
}
}

0 comments on commit 47008ee

Please sign in to comment.