Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

NotTranslator.java 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright 2000-2016 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.v7.data.util.sqlcontainer.query.generator.filter;
  17. import com.vaadin.v7.data.Container.Filter;
  18. import com.vaadin.v7.data.util.filter.IsNull;
  19. import com.vaadin.v7.data.util.filter.Not;
  20. import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper;
  21. /**
  22. * @deprecated As of 8.0, no replacement available.
  23. */
  24. @Deprecated
  25. public class NotTranslator implements FilterTranslator {
  26. @Override
  27. public boolean translatesFilter(Filter filter) {
  28. return filter instanceof Not;
  29. }
  30. @Override
  31. public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
  32. Not not = (Not) filter;
  33. if (not.getFilter() instanceof IsNull) {
  34. IsNull in = (IsNull) not.getFilter();
  35. return QueryBuilder.quote(in.getPropertyId()) + " IS NOT NULL";
  36. }
  37. return "NOT "
  38. + QueryBuilder.getWhereStringForFilter(not.getFilter(), sh);
  39. }
  40. }