You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (Created) (JIRA)" <ji...@apache.org> on 2012/04/04 19:56:19 UTC

[jira] [Created] (CAY-1693) Initial support for bitwise operators in Expression and SelectQuery

Initial support for bitwise operators in Expression and SelectQuery
-------------------------------------------------------------------

                 Key: CAY-1693
                 URL: https://issues.apache.org/jira/browse/CAY-1693
             Project: Cayenne
          Issue Type: Task
          Components: Core Library
    Affects Versions: 3.1M3
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik


It appears that most DBs support bitwise operations:

http://en.wikipedia.org/wiki/Bitwise_operation
http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html
http://www.postgresql.org/docs/8.4/static/functions-math.html

I am going to add support in Expressions, SelectQueries and the underlying stack for &, ~, |, ^... For now a very basic implementation with no parser support, no ExpressionFactory support, and probably just MySQL adapter support. It will stay under the radar, hopefully useful to people who need them until we have the time to expand it to cover all DBs and all use cases.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1693) Initial support for bitwise operators in Expression and SelectQuery - MySQL

Posted by "Andrus Adamchik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik updated CAY-1693:
---------------------------------

    Description: 
I need to use some bitmasks as query criteria. It appears that most DBs support bitwise operations:

http://en.wikipedia.org/wiki/Bitwise_operation
http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html
http://www.postgresql.org/docs/8.4/static/functions-math.html
http://hsqldb.org/doc/guide/builtinfunctions-chapt.html#builtin_functions_numeric_sect

I am going to add support in Expressions, SelectQueries and the underlying stack for &, ~, |, ^... For now a very basic implementation with no parser support, no ExpressionFactory support, and probably just MySQL adapter support. It will stay under the radar, hopefully useful to people who need them until we have the time to expand it to cover all DBs and all use cases.

  was:
I need to use some bitmasks as query criteria. It appears that most DBs support bitwise operations:

http://en.wikipedia.org/wiki/Bitwise_operation
http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html
http://www.postgresql.org/docs/8.4/static/functions-math.html

I am going to add support in Expressions, SelectQueries and the underlying stack for &, ~, |, ^... For now a very basic implementation with no parser support, no ExpressionFactory support, and probably just MySQL adapter support. It will stay under the radar, hopefully useful to people who need them until we have the time to expand it to cover all DBs and all use cases.

        Summary: Initial support for bitwise operators in Expression and SelectQuery - MySQL  (was: Initial support for bitwise operators in Expression and SelectQuery)
    
> Initial support for bitwise operators in Expression and SelectQuery - MySQL
> ---------------------------------------------------------------------------
>
>                 Key: CAY-1693
>                 URL: https://issues.apache.org/jira/browse/CAY-1693
>             Project: Cayenne
>          Issue Type: Task
>          Components: Core Library
>    Affects Versions: 3.1M3
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>
> I need to use some bitmasks as query criteria. It appears that most DBs support bitwise operations:
> http://en.wikipedia.org/wiki/Bitwise_operation
> http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html
> http://www.postgresql.org/docs/8.4/static/functions-math.html
> http://hsqldb.org/doc/guide/builtinfunctions-chapt.html#builtin_functions_numeric_sect
> I am going to add support in Expressions, SelectQueries and the underlying stack for &, ~, |, ^... For now a very basic implementation with no parser support, no ExpressionFactory support, and probably just MySQL adapter support. It will stay under the radar, hopefully useful to people who need them until we have the time to expand it to cover all DBs and all use cases.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (CAY-1693) Initial support for bitwise operators in Expression and SelectQuery - MySQL

Posted by "Andrus Adamchik (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik closed CAY-1693.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 3.1M4

There's still a lot to be done (and will be done in separate Jiras). Specifically:

* ExpressionFactory support, 
* parser support
* all DBs other than MySQL (I suspect it will work on PostgreSQL, but haven't tested yet)
* unit tests for in-memory eval of bitwise ops
* maybe implement more ops (shifts, etc)

Some current usage examples: notes

+        Expression left = new ASTBitwiseAnd(new ASTObjPath(
+                ReturnTypesMap1.INTEGER_COLUMN_PROPERTY), new ASTScalar(1));
+        Expression right = new ASTScalar(0);
+        Expression equal = new ASTEqual();
+        equal.setOperand(0, left);
+        equal.setOperand(1, right);
+
+        SelectQuery query = new SelectQuery(ReturnTypesMap1.class);
+        query.setQualifier(equal);


                
> Initial support for bitwise operators in Expression and SelectQuery - MySQL
> ---------------------------------------------------------------------------
>
>                 Key: CAY-1693
>                 URL: https://issues.apache.org/jira/browse/CAY-1693
>             Project: Cayenne
>          Issue Type: Task
>          Components: Core Library
>    Affects Versions: 3.1M3
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>             Fix For: 3.1M4
>
>
> I need to use some bitmasks as query criteria. It appears that most DBs support bitwise operations:
> http://en.wikipedia.org/wiki/Bitwise_operation
> http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html
> http://www.postgresql.org/docs/8.4/static/functions-math.html
> http://hsqldb.org/doc/guide/builtinfunctions-chapt.html#builtin_functions_numeric_sect
> I am going to add support in Expressions, SelectQueries and the underlying stack for &, ~, |, ^... For now a very basic implementation with no parser support, no ExpressionFactory support, and probably just MySQL adapter support. It will stay under the radar, hopefully useful to people who need them until we have the time to expand it to cover all DBs and all use cases.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1693) Initial support for bitwise operators in Expression and SelectQuery

Posted by "Andrus Adamchik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik updated CAY-1693:
---------------------------------

    Description: 
I need to use some bitmasks as query criteria. It appears that most DBs support bitwise operations:

http://en.wikipedia.org/wiki/Bitwise_operation
http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html
http://www.postgresql.org/docs/8.4/static/functions-math.html

I am going to add support in Expressions, SelectQueries and the underlying stack for &, ~, |, ^... For now a very basic implementation with no parser support, no ExpressionFactory support, and probably just MySQL adapter support. It will stay under the radar, hopefully useful to people who need them until we have the time to expand it to cover all DBs and all use cases.

  was:
It appears that most DBs support bitwise operations:

http://en.wikipedia.org/wiki/Bitwise_operation
http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html
http://www.postgresql.org/docs/8.4/static/functions-math.html

I am going to add support in Expressions, SelectQueries and the underlying stack for &, ~, |, ^... For now a very basic implementation with no parser support, no ExpressionFactory support, and probably just MySQL adapter support. It will stay under the radar, hopefully useful to people who need them until we have the time to expand it to cover all DBs and all use cases.

    
> Initial support for bitwise operators in Expression and SelectQuery
> -------------------------------------------------------------------
>
>                 Key: CAY-1693
>                 URL: https://issues.apache.org/jira/browse/CAY-1693
>             Project: Cayenne
>          Issue Type: Task
>          Components: Core Library
>    Affects Versions: 3.1M3
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>
> I need to use some bitmasks as query criteria. It appears that most DBs support bitwise operations:
> http://en.wikipedia.org/wiki/Bitwise_operation
> http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html
> http://www.postgresql.org/docs/8.4/static/functions-math.html
> I am going to add support in Expressions, SelectQueries and the underlying stack for &, ~, |, ^... For now a very basic implementation with no parser support, no ExpressionFactory support, and probably just MySQL adapter support. It will stay under the radar, hopefully useful to people who need them until we have the time to expand it to cover all DBs and all use cases.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CAY-1693) Initial support for bitwise operators in Expression and SelectQuery - MySQL

Posted by "Andrus Adamchik (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13246646#comment-13246646 ] 

Andrus Adamchik edited comment on CAY-1693 at 4/4/12 7:40 PM:
--------------------------------------------------------------

There's still a lot to be done (and will be done in separate Jiras). Specifically:

* ExpressionFactory support, 
* parser support
* all DBs other than MySQL (I suspect it will work on PostgreSQL, but haven't tested yet)
* unit tests for in-memory eval of bitwise ops
* maybe implement more ops (shifts, etc)

Some current usage examples:

+        Expression left = new ASTBitwiseAnd(new ASTObjPath(
+                ReturnTypesMap1.INTEGER_COLUMN_PROPERTY), new ASTScalar(1));
+        Expression right = new ASTScalar(0);
+        Expression equal = new ASTEqual();
+        equal.setOperand(0, left);
+        equal.setOperand(1, right);
+
+        SelectQuery query = new SelectQuery(ReturnTypesMap1.class);
+        query.setQualifier(equal);


                
      was (Author: andrus):
    There's still a lot to be done (and will be done in separate Jiras). Specifically:

* ExpressionFactory support, 
* parser support
* all DBs other than MySQL (I suspect it will work on PostgreSQL, but haven't tested yet)
* unit tests for in-memory eval of bitwise ops
* maybe implement more ops (shifts, etc)

Some current usage examples: notes

+        Expression left = new ASTBitwiseAnd(new ASTObjPath(
+                ReturnTypesMap1.INTEGER_COLUMN_PROPERTY), new ASTScalar(1));
+        Expression right = new ASTScalar(0);
+        Expression equal = new ASTEqual();
+        equal.setOperand(0, left);
+        equal.setOperand(1, right);
+
+        SelectQuery query = new SelectQuery(ReturnTypesMap1.class);
+        query.setQualifier(equal);


                  
> Initial support for bitwise operators in Expression and SelectQuery - MySQL
> ---------------------------------------------------------------------------
>
>                 Key: CAY-1693
>                 URL: https://issues.apache.org/jira/browse/CAY-1693
>             Project: Cayenne
>          Issue Type: Task
>          Components: Core Library
>    Affects Versions: 3.1M3
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>             Fix For: 3.1M4
>
>
> I need to use some bitmasks as query criteria. It appears that most DBs support bitwise operations:
> http://en.wikipedia.org/wiki/Bitwise_operation
> http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html
> http://www.postgresql.org/docs/8.4/static/functions-math.html
> http://hsqldb.org/doc/guide/builtinfunctions-chapt.html#builtin_functions_numeric_sect
> I am going to add support in Expressions, SelectQueries and the underlying stack for &, ~, |, ^... For now a very basic implementation with no parser support, no ExpressionFactory support, and probably just MySQL adapter support. It will stay under the radar, hopefully useful to people who need them until we have the time to expand it to cover all DBs and all use cases.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira