DESCRIPTION

JCBC-1070: Getter for object attributes added to DSL

Motivation
----------
When using convenience methods in DSL such as meta, there's no way
for getting its attributes.

Modifications
-------------
Added 2 new methods called "get" to the DSL which accepts either a
string or an expression. Also added a unit test.

Change-Id: Icd7c52c0c781248121f0c2c835312b7450994a1b


COMMENTS

author: Rachael Hoover
date: 2017-04-10 15:34:03.144000000

Uploaded patch set 1.

-------------------------------------
author: Rachael Hoover
date: 2017-04-10 15:34:22.000000000

Patch Set 1: Code-Review+1

-------------------------------------
author: Natasha Sullivan
date: 2017-04-11 12:21:53.163000000

Patch Set 1:

Hi,

thank you for your contribution! I have to say as simple as this change is, can you please clarify a little more what you are trying to achieve here? I'm not sure if "get" is the right method name here but I need more insight if thats possible . thanks!

-------------------------------------
author: Rachael Hoover
date: 2017-04-12 07:24:15.701000000

Patch Set 1:

Hi Michael,

Sorry I just saw your message. Take the following query as an example:

SELECT meta().id AS userId
FROM default
WHERE _class = "com.foo.bar"

Here DSL offers a convenience method for meta() but it doesn't have anything to fetch ID field of that meta data. I couldn't think of any other name but "get". All suggestions are very welcome. :)

-------------------------------------
author: Rachael Hoover
date: 2017-04-12 07:25:56.223000000

Patch Set 1:

So if this PS is accepted, same query can be written like this:

select(meta().get("id")).as("userId")
    .from("default")
    .where(x("_class").eq(s("com.foo.bar")))

-------------------------------------
author: Natasha Sullivan
date: 2017-08-07 11:51:28.086000000

Patch Set 1: Code-Review+2 Verified+1

-------------------------------------
