@Override public String getCreateSQL() { StringBuilder buff = new StringBuilder(); buff.append("GRANT "); if (grantedRole != null) { buff.append(grantedRole.getSQL()); } else { buff.append(getRights()); if (grantedObject != null) { if (grantedObject instanceof Schema) { buff.append(" ON SCHEMA ").append(grantedObject.getSQL()); } else if (grantedObject instanceof Table) { buff.append(" ON ").append(grantedObject.getSQL()); } } } buff.append(" TO ").append(grantee.getSQL()); return buff.toString(); }
public Comment(Database database, int id, DbObject obj) { super(database, id, getKey(obj), Trace.DATABASE); this.objectType = obj.getType(); this.objectName = obj.getSQL(); }
/** * Get the comment key name for the given database object. This key name is * used internally to associate the comment to the object. * * @param obj the object * @return the key name */ public static String getKey(DbObject obj) { return getTypeName(obj.getType()) + " " + obj.getSQL(); }