JOOQ generated records set to implement Record4 interface even when set not to

StackOverflow https://stackoverflow.com/questions/23169507

  •  06-07-2023
  •  | 
  •  

Domanda

I am using this genrator setup to create my jooq record objects

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.0.0.xsd">
    <jdbc>
        <driver>com.mysql.jdbc.Driver</driver>
        <url>jdbc:mysql://localhost:3306/local</url>
        <user>a</user>
        <password>b</password>
    </jdbc>
    <generator>
        <name>org.jooq.util.DefaultGenerator</name>
        <database>
            <name>org.jooq.util.mysql.MySQLDatabase</name>
            <includes>.*</includes>
            <excludes></excludes>
            <recordVersionFields></recordVersionFields>
            <recordTimestampFields></recordTimestampFields>
            <dateAsTimestamp>false</dateAsTimestamp>
            <unsignedTypes>true</unsignedTypes>
            <inputSchema>local</inputSchema>
            <outputSchema>heroku_abc</outputSchema>
        </database>
        <generate>
            <relations>true</relations>
            <deprecated>true</deprecated>
            <instanceFields>true</instanceFields>
            <generatedAnnotation>true</generatedAnnotation>
            <records>true</records>
            <pojos>false</pojos>
            <immutablePojos>false</immutablePojos>
            <interfaces>false</interfaces>
            <daos>false</daos>
            <jpaAnnotations>false</jpaAnnotations>
            <validationAnnotations>false</validationAnnotations>
            <globalObjectReferences>true</globalObjectReferences>
        </generate>
        <target>
            <packageName>dk.foo.entities.generated</packageName>
            <directory>/home/user/Development/git/dp/src/main/java/</directory>
        </target>
    </generator>
</configuration>

I can't seem to understand why my generated records implements the Record4 interface. while the record is marked as implementing the interface, it has no implementation of its method resulting in this error message from my IDE - eclipse:

The type BjCategoriesRecord must implement the inherited abstract method

Record4<Integer,Integer,String,Byte>.values(Integer, Integer, String, Byte)

One of my records:

@javax.annotation.Generated(value    = { "http://www.jooq.org", "3.1.0" },
                            comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CategoriesRecord extends org.jooq.impl.UpdatableRecordImpl<dk.foo.entities.generated.tables.records.CategoriesRecord> implements org.jooq.Record4<java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.Byte> {

EDIT: A little look further made this more clear to me. If I ask eclipse to add the unimplemented methods i'll get 4 of these:

@Override
    public Record4<Integer, Integer, String, Byte> value1(Integer value) {
        // TODO Auto-generated method stub
        return null;
    } 

The above signature just doesn't match the ones that otherwise were previously created using code generator...

/**
     * {@inheritDoc}
     */
    @Override
    public java.lang.Integer value1() {
        return getId();
    }

this makes me think of some version mismatch of some sort. The codegen uses 3.0.0 and my project depends on 3.3.0 and the generated records informs me that 3.1.0 was used. What a mess..

È stato utile?

Soluzione

just adapted my dependencies to include the proper version of jooq, jooq-meta and jooq-codegen to use the same version as Ben Manes' pluggin, jooq-gradle-plugin

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top