PersistenceException

Hello, I´ve got a little problem that I can not understand very well, I´ll try to expose it as clearly as I can.
Problem = attribute ORGANIZACION_ID missing
This is my entity defined in JMIX:
Organizacion class
And this is my entity in PGADMIN:
pgadmin
As you can see in postgres I have ORGANIZACION_ID column which doesn´t appear in JMIX. And what this causes is a NULL exception when I try to create a organizacion object. because this column doesn´t appear in jmix and notNull for this attribute = true.
In the changeLog I found the creation of this column although I never named a column like this:
changelog
I saw too that every N-M relation that I create, instead of calling ID column… it takes <ENTITYNAME>_ID column for the PK and for the FK causing the same PersistenceException (NULL exception).

I wonder why is this happening… I´m not sure if this is a problem or if I´m not understanding the way it works.
Things that I´ve done:

  • Delete all changelog and all the database to generate new one with clean entities
  • Delete the changeSet from the changelog but this causes a lot of problems since every association uses this column instead of the ID.
    -Manually change NotNull property from PGADMIN and it works (but I don´t like this to be my solution)

Thank you very much in advance

Hi,

What do you mean by “ORGANIZACION_ID column which doesn´t appear in JMIX?”? You should explicitly add the column to the Java class of your entity. Jmix doesn’t automatically create entity fields.