Example usage for com.amazonaws.services.simpledb.util SimpleDBUtils quoteName

List of usage examples for com.amazonaws.services.simpledb.util SimpleDBUtils quoteName

Introduction

In this page you can find the example usage for com.amazonaws.services.simpledb.util SimpleDBUtils quoteName.

Prototype

public static String quoteName(String name) 

Source Link

Document

Quotes and escapes an attribute name or domain name by wrapping it with backticks and escaping any backticks inside the name.

Usage

From source file:com.dateofrock.simpledbmapper.query.Sort.java

License:Apache License

public String describe() {
    StringBuilder expression = new StringBuilder("order by ");
    if (this.attributeName.equalsIgnoreCase("itemName()")) {
        expression.append(this.attributeName);
    } else {/* w ww. j  ava  2s  . c  om*/
        expression.append(SimpleDBUtils.quoteName(this.attributeName));
    }
    if (this.ordering == Ordering.DESC) {
        expression.append(" ").append(Ordering.DESC.getValue());
    }
    return expression.toString();
}

From source file:com.shelfmap.simplequery.attribute.impl.DefaultAttribute.java

License:Apache License

/**
 * {@inheritDoc }
 */
@Override
public String describe() {
    return SimpleDBUtils.quoteName(getAttributeName());
}

From source file:com.shelfmap.simplequery.expression.impl.DefaultDomainExpression.java

License:Apache License

@Override
public String describe() {
    return selectObject.describe() + " from " + SimpleDBUtils.quoteName(getDomain().getDomainName());
}

From source file:org.grails.datastore.mapping.simpledb.util.SimpleDBUtil.java

License:Apache License

/**
 * Quotes and escapes an attribute name or domain name by wrapping it with backticks and escaping any backticks inside the name.
 * @param name//  w w w.  j  ava2  s . com
 * @return
 */
public static String quoteName(String name) {
    return SimpleDBUtils.quoteName(name);
}

From source file:wwutil.jsoda.SimpleDBService.java

License:Mozilla Public License

public String getFieldAttrName(String modelName, String fieldName) {
    // SimpleDB's attribute name for single Id always maps to "itemName()"
    if (jsoda.getRangeField(modelName) == null && jsoda.isIdField(modelName, fieldName))
        return ITEM_NAME;

    String attrName = jsoda.getFieldAttrMap(modelName).get(fieldName);
    return attrName != null ? SimpleDBUtils.quoteName(attrName) : null;
}

From source file:wwutil.jsoda.SimpleDBService.java

License:Mozilla Public License

private <T> void addFromStr(Query<T> query, StringBuilder sb) {
    sb.append(" from ").append(SimpleDBUtils.quoteName(jsoda.getModelTable(query.modelName)));
}