79564037

Date: 2025-04-09 10:04:16
Score: 2.5
Natty:
Report link
Thanks for your response!
In this case the array is in a BLOB and the access is with an OID. 
Is it possible to use a BYTEA for array?

I have added this type in the xjb file :

                <jaxb:bindings node=".//xsd:element[@name='speedsB64']"> 
                    <hj:basic name="content"> 
                        <orm:column column-definition="bytea" />
                    </hj:basic> 
                </jaxb:bindings>

So the postgres type is bytea but i need to suppress the annotation @Lob on the getter :

    @Basic
    @Column(name = "SPEEDS_B64")
    @Lob
    public byte[] getSpeedsB64() {
        return speedsB64;
    }

else i have this error : 

11:56:09:687 DEBUG SQL - 
    insert 
    into
        OceanRacerSchema.SAIL
        (SPEEDS_B64, ID) 
    values
        (?, ?)
Hibernate: 
    insert 
    into
        OceanRacerSchema.SAIL
        (SPEEDS_B64, ID) 
    values
        (?, ?)
11:56:09:718 WARN SqlExceptionHelper - SQL Error: 0, SQLState: 42804
11:56:09:718 ERROR SqlExceptionHelper - ERREUR: la colonne « speeds_b64 » est de type bytea mais l'expression est de type bigint
  Indice : Vous devez réécrire l'expression ou lui appliquer une transformation de type.
  Position : 59
11:56:09.735 [main] ERROR org.sailquest.model.loader.JsonPolarProvider - Error saving polar : jakarta.persistence.RollbackException: Transaction marked for rollback only.

Is there an other way to use bytea and not Lob?

Thanks for your Help!
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (0.5): i need
  • Blacklisted phrase (1): Is it possible to
  • Whitelisted phrase (-0.5): Thanks for your Help
  • RegEx Blacklisted phrase (1): i have this error
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: ghelle