Changeset 722
- Timestamp:
- 09/27/10 21:50:06 (14 years ago)
- Location:
- VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/ASTPredicate.java
r556 r722 67 67 sb.append("vc_created"); 68 68 break; 69 case QueryParserConstants.VC_OWNER: 70 sb.append("vc_owner"); 71 break; 69 72 case QueryParserConstants.CR_NAME: 70 73 sb.append("cr_name"); -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/WhereClauseBuilder.java
r556 r722 14 14 15 15 import eu.clarin.cmdi.virtualcollectionregistry.model.Creator_; 16 import eu.clarin.cmdi.virtualcollectionregistry.model.User_; 16 17 import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection; 17 18 import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection_; … … 104 105 node.getOperator(), node.getValue()); 105 106 break; 106 case QueryParserConstants.CR_NAME: 107 predicate = makeStringPredicate(data, 108 root.get(VirtualCollection_.creator).get(Creator_.name), 109 node.getOperator(), node.getValue()); 110 break; 111 case QueryParserConstants.CR_EMAIL: 112 predicate = makeStringPredicate(data, 113 root.get(VirtualCollection_.creator).get(Creator_.email), 114 node.getOperator(), node.getValue()); 115 break; 116 case QueryParserConstants.CR_ORGANIZATION: 117 predicate = makeStringPredicate(data, 118 root.get(VirtualCollection_.creator) 119 .get(Creator_.organisation), 107 case QueryParserConstants.VC_STATE: 108 predicate = makeStatePredicate(data, 109 node.getOperator(), node.getValue()); 110 break; 111 case QueryParserConstants.VC_PURPOSE: 112 predicate = makePurposePredicate(data, 113 node.getOperator(), node.getValue()); 114 break; 115 case QueryParserConstants.VC_REPRODUCIBILITY: 116 predicate = makeReproducibilityPredicate(data, 120 117 node.getOperator(), node.getValue()); 121 118 break; … … 130 127 node.getOperator(), node.getValue()); 131 128 break; 132 case QueryParserConstants.VC_STATE: 133 predicate = makeStatePredicate(data, 134 node.getOperator(), node.getValue()); 135 break; 136 case QueryParserConstants.VC_PURPOSE: 137 predicate = makePurposePredicate(data, 138 node.getOperator(), node.getValue()); 139 break; 140 case QueryParserConstants.VC_REPRODUCIBILITY: 141 predicate = makeReproducibilityPredicate(data, 129 case QueryParserConstants.VC_OWNER: 130 predicate = makeStringPredicate(data, 131 root.get(VirtualCollection_.owner).get(User_.name), 132 node.getOperator(), node.getValue()); 133 break; 134 case QueryParserConstants.CR_NAME: 135 predicate = makeStringPredicate(data, 136 root.get(VirtualCollection_.creator).get(Creator_.name), 137 node.getOperator(), node.getValue()); 138 break; 139 case QueryParserConstants.CR_EMAIL: 140 predicate = makeStringPredicate(data, 141 root.get(VirtualCollection_.creator).get(Creator_.email), 142 node.getOperator(), node.getValue()); 143 break; 144 case QueryParserConstants.CR_ORGANIZATION: 145 predicate = makeStringPredicate(data, 146 root.get(VirtualCollection_.creator) 147 .get(Creator_.organisation), 142 148 node.getOperator(), node.getValue()); 143 149 break; … … 167 173 value = value.replace("*", "%"); 168 174 175 System.err.println("VALUE = " + value); 169 176 switch (operator) { 170 177 case QueryParserConstants.EQ: -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/jjtree/eu/clarin/cmdi/virtualcollectionregistry/query/QueryParser.jjt
r556 r722 8 8 PARSER_BEGIN(QueryParser) 9 9 package eu.clarin.cmdi.virtualcollectionregistry.query; 10 10 11 public class QueryParser { 11 12 public QueryParser(String s) { … … 15 16 PARSER_END(QueryParser) 16 17 /* 17 (vc.)name: STRING, EQ, NE 18 (vc.)desciption: STRING, EQ, NE 19 (vc.)created: ISO-DATE, EQ, NE, GT, GE, LT, LE 20 {vc.}modified: ISO-DATE, EQ, NE, GT, GE, LT, LE 21 (vc.)state: { "public", "private", "deleted" }, EQ, NE 18 (vc.)name: STRING (EQ, NE) 19 (vc.)description: STRING (EQ, NE) 20 (vc.)state: { "public", "private", "deleted" } (EQ, NE) 22 21 {vc.}purpose: { "research", "reference", 23 "sample", "future-use" } EQ, NE 24 {vc.}reproducability { "intended", "fluctuating", "untended"} EQ, NE 25 (cr.)creator: STRING, EQ, NE 26 {cr.}email: STRING, EQ, NE 27 {cr.}organization: STRING, EQ, NE 22 "sample", "future-use" } (EQ, NE) 23 {vc.}reproducibility { "intended", "fluctuating", "untended" } (EQ, NE) 24 (vc.)created: ISO-DATE (EQ, NE, GT, GE, LT, LE) 25 {vc.}modified: ISO-DATE (EQ, NE, GT, GE, LT, LE) 26 {vc.}owner STRING (EQ, NE) 27 (cr.)creator: STRING (EQ, NE) 28 {cr.}email: STRING (EQ, NE) 29 {cr.}organization: STRING (EQ, NE) 28 30 */ 29 31 SKIP: { … … 41 43 | <VC_PURPOSE: "purpose"> 42 44 | <VC_REPRODUCIBILITY: "reproducibility"> 45 | <VC_OWNER: "owner"> 43 46 | <CR_NAME: "creator"> 44 47 | <CR_ORGANIZATION: "organization"> … … 104 107 ( ( attribute = <VC_NAME> 105 108 | attribute = <VC_DESC> 109 | attribute = <VC_OWNER> 106 110 | attribute = <CR_NAME> 107 111 | attribute = <CR_ORGANIZATION>
Note: See TracChangeset
for help on using the changeset viewer.