{"action":"created","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4949","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4949/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4949/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4949/events","html_url":"https://github.com/orientechnologies/orientdb/issues/4949","id":105730838,"number":4949,"title":"Named Parameter not working in Order By with an embedded map.","user":{"login":"zig158","id":2231937,"avatar_url":"https://avatars.githubusercontent.com/u/2231937?v=3","gravatar_id":"","url":"https://api.github.com/users/zig158","html_url":"https://github.com/zig158","followers_url":"https://api.github.com/users/zig158/followers","following_url":"https://api.github.com/users/zig158/following{/other_user}","gists_url":"https://api.github.com/users/zig158/gists{/gist_id}","starred_url":"https://api.github.com/users/zig158/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zig158/subscriptions","organizations_url":"https://api.github.com/users/zig158/orgs","repos_url":"https://api.github.com/users/zig158/repos","events_url":"https://api.github.com/users/zig158/events{/privacy}","received_events_url":"https://api.github.com/users/zig158/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/bug","name":"bug","color":"ededed"},{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/sql","name":"sql","color":"ededed"}],"state":"closed","locked":false,"assignee":{"login":"luigidellaquila","id":459289,"avatar_url":"https://avatars.githubusercontent.com/u/459289?v=3","gravatar_id":"","url":"https://api.github.com/users/luigidellaquila","html_url":"https://github.com/luigidellaquila","followers_url":"https://api.github.com/users/luigidellaquila/followers","following_url":"https://api.github.com/users/luigidellaquila/following{/other_user}","gists_url":"https://api.github.com/users/luigidellaquila/gists{/gist_id}","starred_url":"https://api.github.com/users/luigidellaquila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luigidellaquila/subscriptions","organizations_url":"https://api.github.com/users/luigidellaquila/orgs","repos_url":"https://api.github.com/users/luigidellaquila/repos","events_url":"https://api.github.com/users/luigidellaquila/events{/privacy}","received_events_url":"https://api.github.com/users/luigidellaquila/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/orientechnologies/orientdb/milestones/64","html_url":"https://github.com/orientechnologies/orientdb/milestones/2.1.x%20(next%20hotfix)","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/milestones/64/labels","id":1282180,"number":64,"title":"2.1.x (next hotfix)","description":"","creator":{"login":"lvca","id":312606,"avatar_url":"https://avatars.githubusercontent.com/u/312606?v=3","gravatar_id":"","url":"https://api.github.com/users/lvca","html_url":"https://github.com/lvca","followers_url":"https://api.github.com/users/lvca/followers","following_url":"https://api.github.com/users/lvca/following{/other_user}","gists_url":"https://api.github.com/users/lvca/gists{/gist_id}","starred_url":"https://api.github.com/users/lvca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvca/subscriptions","organizations_url":"https://api.github.com/users/lvca/orgs","repos_url":"https://api.github.com/users/lvca/repos","events_url":"https://api.github.com/users/lvca/events{/privacy}","received_events_url":"https://api.github.com/users/lvca/received_events","type":"User","site_admin":false},"open_issues":136,"closed_issues":32,"state":"open","created_at":"2015-08-31T15:18:49Z","updated_at":"2015-09-24T06:50:12Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-09-10T04:47:03Z","updated_at":"2015-09-24T06:50:12Z","closed_at":"2015-09-24T06:50:12Z","body":"I am having an issue somewhat similar to #4776. I am trying to use a named parameter in my order by to prevent sql injection. The query parser is ignoring my named parameter and is treating it as a literal. I am using version 2.1.1.\r\n\r\nHere is an example of what my document looks like.\r\n```\r\n       {  \r\n         \"@rid\":\"19:0\",\r\n         \"@version\":3,\r\n         \"@class\":\"work\",\r\n         \"created\":1441258032,\r\n         \"modified\":1441258203,\r\n         \"state\":\"#14:0\",\r\n         \"properties\":{  \r\n            \"count\":\"0\",\r\n            \"testupdate\":\"1441258203385\"\r\n         }\r\n      }\r\n```\r\n\r\nI have tried both of the following.\r\n      SELECT * FROM Work ORDER BY properties[:obparms]\r\nand\r\n      SELECT * FROM Work ORDER BY properties :obparms\r\nbut this works perfectly\r\n      SELECT * FROM Work ORDER BY properties['count']\r\n\r\nMy java code looks like this.\r\n```\r\n    try(OObjectDatabaseTx db = DBPool.getConnection()){\r\n            Map<String,Object> parameters = new HashMap<String,Object>();\r\n            parameters.put(\"obparms\",\"count\");\r\n            String sql = \"SELECT * FROM Work ORDER BY properties :obparms\"\r\n            return db.query(new OSQLSynchQuery<Work>(sql),parameters);\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/comments/142829443","html_url":"https://github.com/orientechnologies/orientdb/issues/4949#issuecomment-142829443","issue_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4949","id":142829443,"user":{"login":"luigidellaquila","id":459289,"avatar_url":"https://avatars.githubusercontent.com/u/459289?v=3","gravatar_id":"","url":"https://api.github.com/users/luigidellaquila","html_url":"https://github.com/luigidellaquila","followers_url":"https://api.github.com/users/luigidellaquila/followers","following_url":"https://api.github.com/users/luigidellaquila/following{/other_user}","gists_url":"https://api.github.com/users/luigidellaquila/gists{/gist_id}","starred_url":"https://api.github.com/users/luigidellaquila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luigidellaquila/subscriptions","organizations_url":"https://api.github.com/users/luigidellaquila/orgs","repos_url":"https://api.github.com/users/luigidellaquila/repos","events_url":"https://api.github.com/users/luigidellaquila/events{/privacy}","received_events_url":"https://api.github.com/users/luigidellaquila/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T06:50:12Z","updated_at":"2015-09-24T06:50:12Z","body":"Thanks!\r\nClosing\r\n"}}