Changeset 6545


Ignore:
Timestamp:
Oct 1, 2014, 2:48:11 PM (8 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1854: Can't filter or sort on Cufflinks FPKM hi column

Added underscore (_) to the regular expression that validate property names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-stable/src/core/net/sf/basedb/core/query/Hql.java

    r6444 r6545  
    5656 
    5757  /**
    58     A property can only contain the characters a-zA-Z0-9, period(.) or hash (#)
     58    A property can only contain the characters a-zA-Z0-9, period(.), underscore(_) or hash (#)
    5959    It cannot begin or end with a period/hash and cannot have two periods/hashes in a sequence.
    6060    A hash indicates a path to a component while a period indicates a path to another
    6161    entity.
    6262  */
    63   public static final Pattern PROPERTY_REGEXP = Pattern.compile("[a-zA-Z0-9]+((\\.|\\#)[a-zA-Z0-9]+)*");
     63  public static final Pattern PROPERTY_REGEXP = Pattern.compile("[a-zA-Z0-9_]+((\\.|\\#)[a-zA-Z0-9_]+)*");
    6464
    6565  /**
     
    199199      if (!PROPERTY_REGEXP.matcher(property).matches())
    200200      {
    201         throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     201        throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    202202      }
    203203      if (property.endsWith("affyChip"))
     
    234234    if (property != null && !PROPERTY_REGEXP.matcher(property).matches())
    235235    {
    236       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     236      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    237237    }
    238238    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    260260    if (!PROPERTY_REGEXP.matcher(property).matches())
    261261    {
    262       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     262      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    263263    }
    264264    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    287287    if (!PROPERTY_REGEXP.matcher(property).matches())
    288288    {
    289       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     289      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    290290    }
    291291    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    365365    if (!PROPERTY_REGEXP.matcher(property).matches())
    366366    {
    367       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     367      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    368368    }
    369369    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    438438    if (!PROPERTY_REGEXP.matcher(property).matches())
    439439    {
    440       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     440      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    441441    }
    442442    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    484484    if (!PROPERTY_REGEXP.matcher(property).matches())
    485485    {
    486       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     486      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    487487    }
    488488    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    535535    if (!PROPERTY_REGEXP.matcher(property).matches())
    536536    {
    537       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     537      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    538538    }
    539539    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    557557    if (!PROPERTY_REGEXP.matcher(property).matches())
    558558    {
    559       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     559      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    560560    }
    561561    return Restrictions.eq(
Note: See TracChangeset for help on using the changeset viewer.