Hi Anton,

Thank you very much for your message.

That's interesting. I think you've slipped by one line. The problem is the
column called "result", not "status", because that clashes with the local
variable result. I've registered an issue for this:
https://github.com/jOOQ/jOOQ/issues/6191

As a workaround, you could patch the generated code with a post processor
and rename the result variable to something else. Or, you could use a
generator strategy to rename the attribute name for the result column, e.g.
to result_:
https://www.jooq.org/doc/latest/manual/code-generation/codegen-generatorstrategy

Thanks again for reporting,
Lukas

2017-05-08 12:39 GMT+02:00 Anton Seredkin <[email protected]>:

> Dear JOOQ team, please look into this:
>
> Tested with 3.9.2 and 3.9.1. After adding 
> '<pojosEqualsAndHashCode>true</pojosEqualsAndHashCode>'
> faced this:
>
> Error in generated pojo's hashCode method:
>
>     public int hashCode() {
>         final int prime = 31;
>         int result = 1;
>         result = prime * result + ((id == null) ? 0 : id.hashCode());
>         result = prime * result + ((applicationId == null) ? 0 :
> applicationId.hashCode());
>         result = prime * result + ((ruleEngineModelId == null) ? 0 :
> ruleEngineModelId.hashCode());
>         result = prime * result + ((result == null) ? 0 :
> result.hashCode());
> *        result = prime * result + ((status == null) ? 0 :
> status.hashCode());*
>         result = prime * result + ((creationDate == null) ? 0 :
> creationDate.hashCode());
>         return result;
>     }
>
>
>
> *Generator log:*
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:
> maven-compiler-plugin:2.5.1:compile ***: Compilation failure: Compilation
> failure:
> [ERROR] ***/public_/tables/pojos/ApplicationRuleEngineResult.java:[167,43]
> error: incomparable types: int and <null>
> [ERROR] ***public_/tables/pojos/ApplicationRuleEngineResult.java:[167,64]
> error: int cannot be dereferenced
>
> *POJO class:*
>
> public class ApplicationRuleEngineResult implements Serializable {
>
> ...
>     private Long       id;
>     private Long       applicationId;
>     private Long       ruleEngineModelId;
>     private BigDecimal result;
>     private String     status;
>     private DateTime   creationDate;
> ...
>
> create table application_rule_engine_result
> (
> id bigserial primary key,
> application_id bigint,
> rule_engine_model_id bigint,
> result double precision,
> status varchar,
> creation_date timestamp with time zone
> );
>
> There's also a custom Double to BigDecimal converter used by Generator:
>
> public class NumberConverter implements Converter<Double,
> BigDecimal>{...convertion routine...}
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to