Sergey,

> 1. I've just rolled changes back in StoreQuery and in AbstractStoreQuery:
>     void addValue(Field<?> field, Object value);
>     void addValue(Field<?> field, Field<?> value);
> and now it is compiled without errors.

I've checked in a fix. jOOQ now compiles again with javac. This is the fix:
https://github.com/lukaseder/jOOQ/commit/bebc620b4a00e15741d46c951dbb6df8d9886a3d

It's the same problem I've already had in the past:
http://stackoverflow.com/questions/5361513/reference-is-ambiguous-with-generics

> 2. I've found very easy to add simple enhancement: fluent way of settings
> routine parameters (DefaultGenerator attached to message)
> The same idea: http://java.net/projects/jaxb2-commons/pages/Fluent-api
> Now we can create routine using methods "with", for example:
>
>         Registertransaction routine = new Registertransaction()
>                 .withAAddinfo1("info1")
>                 .withAAddinfo2("info2")
>                 .withATerminal("terminal");
>         routine.execute(factoryProxy);
> It's more safe then sending parameters through the static method in
> generated inheritor of PackageImpl because it's very easy to make an error
> when you have bunch of parameters with the same type:
>
>     public static packages.tr_subs.Registertransaction
> registertransaction(org.jooq.Configuration configuration, java.lang.String
> aTerminal, java.lang.String aAddinfo1, java.lang.String aAddinfo2, ...) {
>
> I suppose this way of code generation (plain java, instead of XSLT, for
> example) in simple cases is more easy for understanding and extension.

Thanks for the suggestion. I think this is not really necessary. You
can already use the existing setters of the routine, as in the example
from the manual:

// ------------------------------------------------
PAuthorExists p = new PAuthorExists();
p.setAuthorName("Paulo");
p.execute(configuration);
assertEquals(BigDecimal.ONE, p.getResult());
// ------------------------------------------------

See more details:
http://www.jooq.org/manual/META/PROCEDURE/

Cheers
Lukas

2011/11/8 Sergey Epik <[email protected]>:
> Hi Lukas,
>
> 1. I've just rolled changes back in StoreQuery and in AbstractStoreQuery:
>     void addValue(Field<?> field, Object value);
>     void addValue(Field<?> field, Field<?> value);
> and now it is compiled without errors.
>
> 2. I've found very easy to add simple enhancement: fluent way of settings
> routine parameters (DefaultGenerator attached to message)
> The same idea: http://java.net/projects/jaxb2-commons/pages/Fluent-api
> Now we can create routine using methods "with", for example:
>
>         Registertransaction routine = new Registertransaction()
>                 .withAAddinfo1("info1")
>                 .withAAddinfo2("info2")
>                 .withATerminal("terminal");
>         routine.execute(factoryProxy);
> It's more safe then sending parameters through the static method in
> generated inheritor of PackageImpl because it's very easy to make an error
> when you have bunch of parameters with the same type:
>
>     public static packages.tr_subs.Registertransaction
> registertransaction(org.jooq.Configuration configuration, java.lang.String
> aTerminal, java.lang.String aAddinfo1, java.lang.String aAddinfo2, ...) {
>
> I suppose this way of code generation (plain java, instead of XSLT, for
> example) in simple cases is more easy for understanding and extension.
>
> --
> Best regards,
> Sergey
>
>
> On Tue, Nov 8, 2011 at 6:29 PM, Lukas Eder <[email protected]> wrote:
>>
>> Hello Sergey,
>>
>> > 1. There is a method Record.into that copies values from Record to the
>> > another bean with the same properties. But I  have not found reverse
>> > operation ("copyFrom") in the Record. Does it have sense? Or better to
>> > use
>> > something like BeanUtils.copyProperties?
>>
>> That's a very nice idea. I filed this as feature request #912:
>> https://sourceforge.net/apps/trac/jooq/ticket/912
>>
>> > 2. I am not sure that JooqUtil.isJPAAvailable works correctly, because
>> > Column class is in the import and we can not load class JooqUtil without
>> > Column (we will have ClassNotFound exception, at least in OSGI
>> > container).
>> > If we want to check availability of column class we have remove binary
>> > dependency and replace
>> > Class.forName(Column.class.getName());
>> > with
>> > Class.forName("javax.persistence.Column");
>> > and move all javax.persistence - dependent operations to a separate
>> > class.
>>
>> Hmm, I wasn't aware of that. I thought classes were loaded lazily by
>> class loaders? But then, the same applies to JooqLogger (log4j,
>> slf4j), and OracleUtils (ojdbc), right? There are binary dependencies
>> in those classes as well.
>>
>> I find the Java reflection API clumsy enough already. If I have to
>> operate on annotations using reflection, that code tends to become
>> quite verbose. What is the OSGI way of creating "light" dependencies?
>> Is there no "middle way"?
>>
>> By the way: Do you have some pointers for me (links, tutorials) to set
>> up an OSGI-enabled environment? If I'm going to support that, I need
>> to do some integration testing.
>>
>> > 3. I see no reason to use maven-bundle-plugin (OSGI - related) in
>> > modules
>> > jOOQ-codegen and jOOQ-codegen-maven at this moment, only in jOOQ and
>> > jOOQ-spring
>>
>> Can you explain, please? I've been oblivious to OSGI so far.
>>
>> > 4. I am trying to synchronize with source control repository and have
>> > the
>> > following compilation error:
>> >
>> > [INFO] Compilation failure
>> > \projects\jooq\jOOQ\src\main\java\org\jooq\impl\InsertImpl.java:[130,25]
>> > reference to addValue is ambiguous, both method
>> > <T>addValue(org.jooq.Field<T>,T) in org.jooq.StoreQuery<R> and method
>> > <T>addValue(org.jooq.Field<T>,org.jooq.Field<T>) in
>> > org.jooq.StoreQuery<R>
>> > match
>>
>> Thanks for reporting this. I keep running into these sorts of
>> compilation errors due to a bug either in javac or in the Eclipse
>> compiler. The Eclipse compiler is known to be quite different and more
>> lenient in the way it handles generics in overloaded methods. I'll fix
>> this ASAP
>>
>> > Do you known how to fix it?
>>
>> I hope I don't have to change the API. You could try playing around
>> with the casts applied to line 130 of InsertImpl.
>>
>> Cheers
>> Lukas
>>
>> 2011/11/8 Sergey Epik <[email protected]>:
>> > Hi Lukas,
>> >
>> > I am very happy to use jOOQ and have some questions/issues:
>> >
>> > 1. There is a method Record.into that copies values from Record to the
>> > another bean with the same properties. But I  have not found reverse
>> > operation ("copyFrom") in the Record. Does it have sense? Or better to
>> > use
>> > something like BeanUtils.copyProperties?
>> >
>> > 2. I am not sure that JooqUtil.isJPAAvailable works correctly, because
>> > Column class is in the import and we can not load class JooqUtil without
>> > Column (we will have ClassNotFound exception, at least in OSGI
>> > container).
>> > If we want to check availability of column class we have remove binary
>> > dependency and replace
>> > Class.forName(Column.class.getName());
>> > with
>> > Class.forName("javax.persistence.Column");
>> > and move all javax.persistence - dependent operations to a separate
>> > class.
>> >
>> > 3. I see no reason to use maven-bundle-plugin (OSGI - related) in
>> > modules
>> > jOOQ-codegen and jOOQ-codegen-maven at this moment, only in jOOQ and
>> > jOOQ-spring
>> >
>> > 4. I am trying to synchronize with source control repository and have
>> > the
>> > following compilation error:
>> >
>> > [INFO] Compilation failure
>> > \projects\jooq\jOOQ\src\main\java\org\jooq\impl\InsertImpl.java:[130,25]
>> > reference to addValue is ambiguous, both method
>> > <T>addValue(org.jooq.Field<T>,T) in org.jooq.StoreQuery<R> and method
>> > <T>addValue(org.jooq.Field<T>,org.jooq.Field<T>) in
>> > org.jooq.StoreQuery<R>
>> > match
>> >
>> > Do you known how to fix it?
>> >
>> > --
>> > Best regards, Sergey
>> >
>
>

Reply via email to