Last object in key path

2016-05-19 Thread Lon Varscsak
Hey guys,

I’m trying to do something where right before setting a value, I want to
lookup and call a validation routine.  I was looking for a method where I
could get the target object for a given property, but I can’t seem to find
one that’s exposed.

So for a key path of “key1.key2.key3” when setting a value, I’d like to try
to lookup a method on the object represented by “key2” and call that first,
and then conditionally call the set.  Any ideas?

Thanks,

Lon


Re: [dbutils] Would it be possible to have parameters passed to QueryRunner as an Iterable?

2016-05-19 Thread Robert Huffman
Actually, Iterable doesn't work: in fillStatement you need to know the size
and that's not easily obtainable from an Iterable. So I'm using Collection
instead.

I cloned the project and have QueryRunner.query working already. Basically
I changed the private query method to take a Collection instead of varargs
for the parameters. A public method is added that takes a Collection, and
the public methods that take arrays simply use Arrays.asList on the
arrays.  You can check out the approach here:

https://github.com/rhuffman/commons-dbutils/tree/feature/allow-collections-of-parameters-in-QueryRunner

I will take the same approach on update, insert and batch, create a JIRA
and attach a patch.




On Thu, May 19, 2016 at 6:02 AM, Benedikt Ritter  wrote:

> Hello Robert,
>
> Robert Huffman  schrieb am Mi., 18. Mai 2016 um
> 19:00 Uhr:
>
> > If a prepared statement is built dynamically, with a variable number of
> > parameters, and parameters are collected in a Collection of some sort
> > instead of an array, usage QueryRunner requires that the collection be
> > converted to an array first. This means the parameters are iterated
> twice:
> > once to convert to an array and once again in QueryRunner.fillStatement.
> >
> > Would it violate a design decision if methods were added to QueryRunner
> > that took the parameters as an Iterable instead of as varags? It should
> be
> > straightforward to add such methods and use an Iterable wrapper around an
> > array to have the varargs methods invoke the new methods that take
> > Iterables.
> >
> > I would be happy to submit a patch if this does not violate some sort of
> > design decision I am not aware of and if the implementation approach
> sounds
> > reasonable.
> >
>
> Sounds like a reasonable addition, although I'm not sure I understand your
> proposal with the "Iterable wrapper around an array". Feel free to create a
> JIRA and provide a patch/github PR for adding this functionality. Further
> design discussions about this addition should go to the dev mailing list.
>
> Benedikt
>


Re: [dbutils] Would it be possible to have parameters passed to QueryRunner as an Iterable?

2016-05-19 Thread Benedikt Ritter
Hello Robert,

Robert Huffman  schrieb am Mi., 18. Mai 2016 um
19:00 Uhr:

> If a prepared statement is built dynamically, with a variable number of
> parameters, and parameters are collected in a Collection of some sort
> instead of an array, usage QueryRunner requires that the collection be
> converted to an array first. This means the parameters are iterated twice:
> once to convert to an array and once again in QueryRunner.fillStatement.
>
> Would it violate a design decision if methods were added to QueryRunner
> that took the parameters as an Iterable instead of as varags? It should be
> straightforward to add such methods and use an Iterable wrapper around an
> array to have the varargs methods invoke the new methods that take
> Iterables.
>
> I would be happy to submit a patch if this does not violate some sort of
> design decision I am not aware of and if the implementation approach sounds
> reasonable.
>

Sounds like a reasonable addition, although I'm not sure I understand your
proposal with the "Iterable wrapper around an array". Feel free to create a
JIRA and provide a patch/github PR for adding this functionality. Further
design discussions about this addition should go to the dev mailing list.

Benedikt


Re: [ANNOUNCE] Apache Commons Crypto component established

2016-05-19 Thread Benedikt Ritter
Hello Konrad,

Konrad Zuse  schrieb am Fr., 13. Mai 2016 um
02:28 Uhr:

> This is interesting.  I am curious how well this will work with Apache
> Shiro, and if there would be any issues integrating this Library with Shiro?
>

I don't know Shiro, so I can not tell. Just give it a try an let us know if
you encounter any issues.

Benedikt


>
> Thanks for the help.
> 
> From: Benedikt Ritter 
> Sent: Monday, May 9, 2016 3:53:33 PM
> To: annou...@apache.org; Commons Developers List; Commons Users List
> Subject: [ANNOUNCE] Apache Commons Crypto component established
>
> The Apache Commons team is pleased to announce the establishment of a new
> component: Apache Commons Crypto.
>
> Apache Commons Crypto is a cryptographic library optimized with AES-NI
> (Advanced Encryption Standard New Instructions). It provides Java API for
> both cipher level and Java stream level. Developers can use it to implement
> high performance AES encryption/decryption with the minimum code and
> effort. Please note that Apache Commons Crypto doesn't implement the
> cryptographic algorithm such as AES directly. It wraps to Openssl or JCE
> which implement the algorithms.
>
> The Apache Commons team is currently working on the initial release, which
> is expected soon. We invite everybody interested to join the development on
> Apache Commons Crypto.
>
> More information can be found on the project website:
>
> http://commons.apache.org/crypto
>
> The source code is available in the Apache Commons Crypto git repository:
>
> https://git-wip-us.apache.org/repos/asf/commons-crypto.git
>
> Have fun!
> Benedikt Ritter, on behalf of the Apache Commons Community
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>