@@ -523,98 +523,118 @@ public QueryBuilder<T> equal(Property<T> property, long value) { |
523 | 523 | return this; |
524 | 524 | } |
525 | 525 |
|
526 | | - public QueryBuilder<T> equal(Property<T> property, boolean value) { |
| 526 | + public QueryBuilder<T> notEqual(Property<T> property, long value) { |
527 | 527 | verifyHandle(); |
528 | | - checkCombineCondition(nativeEqual(handle, property.getId(), value ? 1 : 0)); |
| 528 | + checkCombineCondition(nativeNotEqual(handle, property.getId(), value)); |
529 | 529 | return this; |
530 | 530 | } |
531 | 531 |
|
532 | | - /** @throws NullPointerException if given value is null. Use {@link #isNull(Property)} instead. */ |
533 | | - public QueryBuilder<T> equal(Property<T> property, Date value) { |
| 532 | + public QueryBuilder<T> less(Property<T> property, long value) { |
534 | 533 | verifyHandle(); |
535 | | - checkCombineCondition(nativeEqual(handle, property.getId(), value.getTime())); |
| 534 | + checkCombineCondition(nativeLess(handle, property.getId(), value)); |
536 | 535 | return this; |
537 | 536 | } |
538 | 537 |
|
539 | | - public QueryBuilder<T> notEqual(Property<T> property, long value) { |
| 538 | + public QueryBuilder<T> greater(Property<T> property, long value) { |
540 | 539 | verifyHandle(); |
541 | | - checkCombineCondition(nativeNotEqual(handle, property.getId(), value)); |
| 540 | + checkCombineCondition(nativeGreater(handle, property.getId(), value)); |
542 | 541 | return this; |
543 | 542 | } |
544 | 543 |
|
545 | | - public QueryBuilder<T> notEqual(Property<T> property, boolean value) { |
| 544 | + public QueryBuilder<T> between(Property<T> property, long value1, long value2) { |
546 | 545 | verifyHandle(); |
547 | | - checkCombineCondition(nativeNotEqual(handle, property.getId(), value ? 1 : 0)); |
| 546 | + checkCombineCondition(nativeBetween(handle, property.getId(), value1, value2)); |
548 | 547 | return this; |
549 | 548 | } |
550 | 549 |
|
551 | | - /** @throws NullPointerException if given value is null. Use {@link #isNull(Property)} instead. */ |
552 | | - public QueryBuilder<T> notEqual(Property<T> property, Date value) { |
| 550 | + // FIXME DbException: invalid unordered_map<K, T> key |
| 551 | + public QueryBuilder<T> in(Property<T> property, long[] values) { |
553 | 552 | verifyHandle(); |
554 | | - checkCombineCondition(nativeNotEqual(handle, property.getId(), value.getTime())); |
| 553 | + checkCombineCondition(nativeIn(handle, property.getId(), values, false)); |
555 | 554 | return this; |
556 | 555 | } |
557 | 556 |
|
558 | | - public QueryBuilder<T> less(Property<T> property, long value) { |
| 557 | + public QueryBuilder<T> notIn(Property<T> property, long[] values) { |
559 | 558 | verifyHandle(); |
560 | | - checkCombineCondition(nativeLess(handle, property.getId(), value)); |
| 559 | + checkCombineCondition(nativeIn(handle, property.getId(), values, true)); |
561 | 560 | return this; |
562 | 561 | } |
563 | 562 |
|
564 | | - public QueryBuilder<T> greater(Property<T> property, long value) { |
| 563 | + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 564 | + // Integers -> int[] |
| 565 | + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 566 | + |
| 567 | + public QueryBuilder<T> in(Property<T> property, int[] values) { |
565 | 568 | verifyHandle(); |
566 | | - checkCombineCondition(nativeGreater(handle, property.getId(), value)); |
| 569 | + checkCombineCondition(nativeIn(handle, property.getId(), values, false)); |
567 | 570 | return this; |
568 | 571 | } |
569 | 572 |
|
570 | | - public QueryBuilder<T> less(Property<T> property, Date value) { |
| 573 | + public QueryBuilder<T> notIn(Property<T> property, int[] values) { |
571 | 574 | verifyHandle(); |
572 | | - checkCombineCondition(nativeLess(handle, property.getId(), value.getTime())); |
| 575 | + checkCombineCondition(nativeIn(handle, property.getId(), values, true)); |
573 | 576 | return this; |
574 | 577 | } |
575 | 578 |
|
576 | | - /** @throws NullPointerException if given value is null. Use {@link #isNull(Property)} instead. */ |
577 | | - public QueryBuilder<T> greater(Property<T> property, Date value) { |
| 579 | + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 580 | + // Integers -> boolean |
| 581 | + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 582 | + |
| 583 | + public QueryBuilder<T> equal(Property<T> property, boolean value) { |
578 | 584 | verifyHandle(); |
579 | | - checkCombineCondition(nativeGreater(handle, property.getId(), value.getTime())); |
| 585 | + checkCombineCondition(nativeEqual(handle, property.getId(), value ? 1 : 0)); |
580 | 586 | return this; |
581 | 587 | } |
582 | 588 |
|
583 | | - public QueryBuilder<T> between(Property<T> property, long value1, long value2) { |
| 589 | + public QueryBuilder<T> notEqual(Property<T> property, boolean value) { |
584 | 590 | verifyHandle(); |
585 | | - checkCombineCondition(nativeBetween(handle, property.getId(), value1, value2)); |
| 591 | + checkCombineCondition(nativeNotEqual(handle, property.getId(), value ? 1 : 0)); |
586 | 592 | return this; |
587 | 593 | } |
588 | 594 |
|
589 | | - /** @throws NullPointerException if one of the given values is null. */ |
590 | | - public QueryBuilder<T> between(Property<T> property, Date value1, Date value2) { |
| 595 | + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 596 | + // Integers -> Date |
| 597 | + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 598 | + |
| 599 | + /** |
| 600 | + * @throws NullPointerException if given value is null. Use {@link #isNull(Property)} instead. |
| 601 | + */ |
| 602 | + public QueryBuilder<T> equal(Property<T> property, Date value) { |
591 | 603 | verifyHandle(); |
592 | | - checkCombineCondition(nativeBetween(handle, property.getId(), value1.getTime(), value2.getTime())); |
| 604 | + checkCombineCondition(nativeEqual(handle, property.getId(), value.getTime())); |
593 | 605 | return this; |
594 | 606 | } |
595 | 607 |
|
596 | | - // FIXME DbException: invalid unordered_map<K, T> key |
597 | | - public QueryBuilder<T> in(Property<T> property, long[] values) { |
| 608 | + /** |
| 609 | + * @throws NullPointerException if given value is null. Use {@link #isNull(Property)} instead. |
| 610 | + */ |
| 611 | + public QueryBuilder<T> notEqual(Property<T> property, Date value) { |
598 | 612 | verifyHandle(); |
599 | | - checkCombineCondition(nativeIn(handle, property.getId(), values, false)); |
| 613 | + checkCombineCondition(nativeNotEqual(handle, property.getId(), value.getTime())); |
600 | 614 | return this; |
601 | 615 | } |
602 | 616 |
|
603 | | - public QueryBuilder<T> in(Property<T> property, int[] values) { |
| 617 | + public QueryBuilder<T> less(Property<T> property, Date value) { |
604 | 618 | verifyHandle(); |
605 | | - checkCombineCondition(nativeIn(handle, property.getId(), values, false)); |
| 619 | + checkCombineCondition(nativeLess(handle, property.getId(), value.getTime())); |
606 | 620 | return this; |
607 | 621 | } |
608 | 622 |
|
609 | | - public QueryBuilder<T> notIn(Property<T> property, long[] values) { |
| 623 | + /** |
| 624 | + * @throws NullPointerException if given value is null. Use {@link #isNull(Property)} instead. |
| 625 | + */ |
| 626 | + public QueryBuilder<T> greater(Property<T> property, Date value) { |
610 | 627 | verifyHandle(); |
611 | | - checkCombineCondition(nativeIn(handle, property.getId(), values, true)); |
| 628 | + checkCombineCondition(nativeGreater(handle, property.getId(), value.getTime())); |
612 | 629 | return this; |
613 | 630 | } |
614 | 631 |
|
615 | | - public QueryBuilder<T> notIn(Property<T> property, int[] values) { |
| 632 | + /** |
| 633 | + * @throws NullPointerException if one of the given values is null. |
| 634 | + */ |
| 635 | + public QueryBuilder<T> between(Property<T> property, Date value1, Date value2) { |
616 | 636 | verifyHandle(); |
617 | | - checkCombineCondition(nativeIn(handle, property.getId(), values, true)); |
| 637 | + checkCombineCondition(nativeBetween(handle, property.getId(), value1.getTime(), value2.getTime())); |
618 | 638 | return this; |
619 | 639 | } |
620 | 640 |
|
|