Andreas Covidiot
Andreas Covidiot

Reputation: 4765

Attribute Override "..." cannot be resolved to an attribute on the

We got Eclipse errors (from the JPA Problem validator) like this:

Attribute override "<myAttrName>" cannot be resolved to an attribute on the embeddable "..."

with embeddable (maybe also something like mapped super class) on some JPA attribute we wanted to override properly, e.g. like this:

@Embeddable
public class DaoUsrMod {

    @ManyToOne( fetch = FetchType.LAZY )
    @JoinColumn( name = "u_lmod_id" , insertable = false , updatable = false )
    private DaoUser usr ;
    ...
}


@Entity
public class DaoFoo {

    @Embedded
    @AttributeOverrides( {
        @AttributeOverride( name = "usr" ,  column = @Column( name = "u_created_id" ) )
    } )
    private DaoUsrMod                                               usrModAngel ;

    ...
}

Upvotes: 1

Views: 2677

Answers (1)

Andreas Covidiot
Andreas Covidiot

Reputation: 4765

It seems this is an Eclipse bug and so you can change this type of ERROR to a less dominant level (we changed it to WARNING) here (for Eclipse Neon):

Project -> Properties -> JPA -> Errors/Warnings -> Database 
  -> Attribute/association overrides
    (2nd entry:)
    -> Attribute override name cannot be resolved to an attribute: [Error]

e.g. to:

  -> Attribute override name cannot be resolved to an attribute: [Warning]

Took the solution from the zonacroft blog

Upvotes: 1

Related Questions