日期:2014-05-16 浏览次数:20530 次
db4o的SODA查询貌似不支持正则匹配。API中关于Constraint接口的Method Summary如下
?Constraint
|
and
(Constraint
?with)
??????????links two Constraints for AND evaluation. |
?Constraint
|
byExample
()
??????????set the evaluation mode to object comparison (query by example). |
?Constraint
|
contains
()
??????????sets the evaluation mode to containment comparison. |
?Constraint
|
endsWith
(boolean?caseSensitive)
??????????sets the evaluation mode to string endsWith comparison. |
?Constraint
|
equal
()
??????????Used in conjunction with smaller()
or greater()
to create constraints
like "smaller or equal", "greater or equal". |
?java.lang.Object
|
getObject
()
??????????returns the Object the query graph was constrained with to create this Constraint
. |
?Constraint
|
greater
()
??????????sets the evaluation mode to >
. |
?Constraint
|
identity
()
??????????sets the evaluation mode to identity comparison. |
?Constraint
|
like
()
??????????sets the evaluation mode to "like" comparison. |
?Constraint
|
not
()
??????????turns on not() comparison. |
?Constraint
|
or
(Constraint
?with)
??????????links two Constraints for OR evaluation. |
?Constraint
|
smaller
()
??????????sets the evaluation mode to <
. |
?Constraint
|
startsWith
(boolean?caseSensitive)
??????????sets the evaluation mode to string startsWith comparison. |
?
endsWith跟
startsWith只提供了很弱的字符串匹配功能,不能实现正则表达式模式的匹配。
?
在db4o论坛找到这么一个帖子(http://developer.db4o.com/Forums/tabid/98/aft/10103/Default.aspx),有个叫gamlerhart的人的回复很有意思。
11 Aug 2010 10:51 AM | ? |
Just a note to the Regex-Evaluation. It's possible to make it more generic. Build an evaluator to run the regex against a string. Then descend to the string-field and use the evaluator on
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
|