SqlView extends BaseIdentifiableObject implements Cacheable, MetadataObject { public static boolean isValidQueryValue( String value ) { return value != null && value.matches( QUERY_VALUE_REGEX ); } SqlView();  SqlView( String name, String sqlQuery, SqlViewType type ); String getViewName(); static Map<String, String> getCriteria( Set<String> params ); static Set<String> getInvalidQueryParams( Set<String> params ); static boolean isValidQueryParam( String param ); static Set<String> getInvalidQueryValues( Collection<String> values ); static boolean isValidQueryValue( String value ); static String getProtectedTablesRegex(); static String getIllegalKeywordsRegex(); boolean isQuery(); boolean isView(); boolean isMaterializedView(); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) @PropertyRange( min = 2 ) String getDescription(); void setDescription( String description ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) String getSqlQuery(); void setSqlQuery( String sqlQuery ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) SqlViewType getType(); void setType( SqlViewType type ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) @Override CacheStrategy getCacheStrategy(); void setCacheStrategy( CacheStrategy cacheStrategy ); static final String PREFIX_VIEWNAME; static final Set<String> PROTECTED_TABLES; static final Set<String> ILLEGAL_KEYWORDS; static final String CURRENT_USER_ID_VARIABLE; static final String CURRENT_USERNAME_VARIABLE; static final Set<String> STANDARD_VARIABLES; }
@Test public void testIsValidQueryValue() { assertTrue( SqlView.isValidQueryValue( "east" ) ); assertTrue( SqlView.isValidQueryValue( "NUMBER" ) ); assertTrue( SqlView.isValidQueryValue( "2015-03-01" ) ); assertTrue( SqlView.isValidQueryValue( "John Doe" ) ); assertTrue( SqlView.isValidQueryValue( "anc_1" ) ); assertFalse( SqlView.isValidQueryValue( "../var/dir" ) ); assertFalse( SqlView.isValidQueryValue( "delete from table;" ) ); }