kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 64c589fc93014af0c5dbbf882c9ca89eac23cfb5a91c0b1689c0c4b0453ab44d |
|---|---|
| Author | Sylvain Lebresne <sylvain@datastax.com> · 2013-12-13 12:22 +01:00 |
| Committer | Sylvain Lebresne <sylvain@datastax.com> · 2013-12-13 14:12 +01:00 |
| Parents | 29687dcadd50 |
2 files changed
modified driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java +24 −0
| @@ -684,6 +684,8 @@ | ||
| 684 | 684 | |
| 685 | 685 | /** |
| 686 | 686 | * Sets the {@code i}th value to the provided list. |
| 687 | + * <p> | |
| 688 | + * Please note that {@code null} values are not supported inside collection by CQL. | |
| 687 | 689 | * |
| 688 | 690 | * @param i the index of the variable to set. |
| 689 | 691 | * @param v the value to set. |
| @@ -693,6 +695,8 @@ | ||
| 693 | 695 | * @throws InvalidTypeException if column {@code i} is not a list type or |
| 694 | 696 | * if the elements of {@code v} are not of the type of the elements of |
| 695 | 697 | * column {@code i}. |
| 698 | + * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections | |
| 699 | + * by CQL. | |
| 696 | 700 | */ |
| 697 | 701 | public <T> BoundStatement setList(int i, List<T> v) { |
| 698 | 702 | DataType type = metadata().getType(i); |
| @@ -717,6 +721,8 @@ | ||
| 717 | 721 | |
| 718 | 722 | /** |
| 719 | 723 | * Sets the value for the first occurrence of column {@code name} to the provided list. |
| 724 | + * <p> | |
| 725 | + * Please note that {@code null} values are not supported inside collection by CQL. | |
| 720 | 726 | * |
| 721 | 727 | * @param name the name of the variable to set; if multiple variables |
| 722 | 728 | * {@code name} are prepared, only the first one is set. |
| @@ -728,6 +734,8 @@ | ||
| 728 | 734 | * @throws InvalidTypeException if column {@code name} is not a list type or |
| 729 | 735 | * if the elements of {@code v} are not of the type of the elements of |
| 730 | 736 | * column {@code name}. |
| 737 | + * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections | |
| 738 | + * by CQL. | |
| 731 | 739 | */ |
| 732 | 740 | public <T> BoundStatement setList(String name, List<T> v) { |
| 733 | 741 | return setList(metadata().getIdx(name), v); |
| @@ -735,6 +743,8 @@ | ||
| 735 | 743 | |
| 736 | 744 | /** |
| 737 | 745 | * Sets the {@code i}th value to the provided map. |
| 746 | + * <p> | |
| 747 | + * Please note that {@code null} values are not supported inside collection by CQL. | |
| 738 | 748 | * |
| 739 | 749 | * @param i the index of the variable to set. |
| 740 | 750 | * @param v the value to set. |
| @@ -744,6 +754,8 @@ | ||
| 744 | 754 | * @throws InvalidTypeException if column {@code i} is not a map type or |
| 745 | 755 | * if the elements (keys or values) of {@code v} are not of the type of the |
| 746 | 756 | * elements of column {@code i}. |
| 757 | + * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections | |
| 758 | + * by CQL. | |
| 747 | 759 | */ |
| 748 | 760 | public <K, V> BoundStatement setMap(int i, Map<K, V> v) { |
| 749 | 761 | DataType type = metadata().getType(i); |
| @@ -770,6 +782,8 @@ | ||
| 770 | 782 | |
| 771 | 783 | /** |
| 772 | 784 | * Sets the value for the first occurrence of column {@code name} to the provided map. |
| 785 | + * <p> | |
| 786 | + * Please note that {@code null} values are not supported inside collection by CQL. | |
| 773 | 787 | * |
| 774 | 788 | * @param name the name of the variable to set; if multiple variables |
| 775 | 789 | * {@code name} are prepared, only the first one is set. |
| @@ -781,6 +795,8 @@ | ||
| 781 | 795 | * @throws InvalidTypeException if column {@code name} is not a map type or |
| 782 | 796 | * if the elements (keys or values) of {@code v} are not of the type of the |
| 783 | 797 | * elements of column {@code name}. |
| 798 | + * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections | |
| 799 | + * by CQL. | |
| 784 | 800 | */ |
| 785 | 801 | public <K, V> BoundStatement setMap(String name, Map<K, V> v) { |
| 786 | 802 | return setMap(metadata().getIdx(name), v); |
| @@ -788,6 +804,8 @@ | ||
| 788 | 804 | |
| 789 | 805 | /** |
| 790 | 806 | * Sets the {@code i}th value to the provided set. |
| 807 | + * <p> | |
| 808 | + * Please note that {@code null} values are not supported inside collection by CQL. | |
| 791 | 809 | * |
| 792 | 810 | * @param i the index of the variable to set. |
| 793 | 811 | * @param v the value to set. |
| @@ -797,6 +815,8 @@ | ||
| 797 | 815 | * @throws InvalidTypeException if column {@code i} is not a set type or |
| 798 | 816 | * if the elements of {@code v} are not of the type of the elements of |
| 799 | 817 | * column {@code i}. |
| 818 | + * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections | |
| 819 | + * by CQL. | |
| 800 | 820 | */ |
| 801 | 821 | public <T> BoundStatement setSet(int i, Set<T> v) { |
| 802 | 822 | DataType type = metadata().getType(i); |
| @@ -820,6 +840,8 @@ | ||
| 820 | 840 | |
| 821 | 841 | /** |
| 822 | 842 | * Sets the value for the first occurrence of column {@code name} to the provided set. |
| 843 | + * <p> | |
| 844 | + * Please note that {@code null} values are not supported inside collection by CQL. | |
| 823 | 845 | * |
| 824 | 846 | * @param name the name of the variable to set; if multiple variables |
| 825 | 847 | * {@code name} are prepared, only the first one is set. |
| @@ -831,6 +853,8 @@ | ||
| 831 | 853 | * @throws InvalidTypeException if column {@code name} is not a set type or |
| 832 | 854 | * if the elements of {@code v} are not of the type of the elements of |
| 833 | 855 | * column {@code name}. |
| 856 | + * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections | |
| 857 | + * by CQL. | |
| 834 | 858 | */ |
| 835 | 859 | public <T> BoundStatement setSet(String name, Set<T> v) { |
| 836 | 860 | return setSet(metadata().getIdx(name), v); |
modified driver-core/src/main/java/com/datastax/driver/core/PreparedStatement.java +1 −2
| @@ -167,8 +167,7 @@ | ||
| 167 | 167 | * |
| 168 | 168 | * @return the newly created {@code BoundStatement}. |
| 169 | 169 | */ |
| 170 | - public BoundStatement bind() | |
| 171 | - { | |
| 170 | + public BoundStatement bind() { | |
| 172 | 171 | return new BoundStatement(this); |
| 173 | 172 | } |
| 174 | 173 |