Skip to content

Commit 4664d66

Browse files
foisysandreasprlic
authored andcommitted
/* Loading objects. */
1 parent ed49229 commit 4664d66

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

_wikis/BioJava:BioJavaXDocs.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,8 +2287,10 @@ directly without specifying which field to use. This query returns all
22872287
RichSequence objects that have a comment that contains the word
22882288
"rubbish" with a rank of 0:
22892289

2290-
<java> Query q = session.createQuery("select rs from Sequence as rs join
2291-
Comment as c where c.comment like :comment and rank=:rank");
2290+
<java> Query q = session.createQuery(
2291+
2292+
`         "select rs from Sequence as rs join Comment as c where c.comment like :comment and rank=:rank");`
2293+
22922294
q.setString("comment","%rubbish%"); // % symbol means match any string
22932295
q.setInteger("rank",0); List sequences = q.list(); // a list of all
22942296
matching RichSequence objects. </java>

_wikis/BioJava:BioJavaXDocs.mediawiki

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,8 @@ Namespace ns = (Namespace)q.uniqueObject(); // alternative notation for queries
21972197
You don't have to worry about foreign keys, and can just join objects directly without specifying which field to use. This query returns all RichSequence objects that have a comment that contains the word "rubbish" with a rank of 0:
21982198

21992199
<java>
2200-
Query q = session.createQuery("select rs from Sequence as rs join Comment as c where c.comment like :comment and rank=:rank");
2200+
Query q = session.createQuery(
2201+
"select rs from Sequence as rs join Comment as c where c.comment like :comment and rank=:rank");
22012202
q.setString("comment","%rubbish%"); // % symbol means match any string
22022203
q.setInteger("rank",0);
22032204
List sequences = q.list(); // a list of all matching RichSequence objects.

0 commit comments

Comments
 (0)