title: Hibernate @ManyToOne mapping error
body: <p>Good day to you. I have 2 tables.</p>
  
  <pre><code> CREATE TABLE A(
    id NUMBER(10) NOT NULL,
    name VARCHAR2(255) NULL,
    category VARCHAR2(255) NULL,
    is_hidder NUMBER(1) NULL,
    is_enabled NUMBER(1) NULL,
    b_id NUMBER(10) NULL,
    CONSTRAINT pk_a PRIMARY KEY (ID),
    CONSTRAINT fk_to_b
    FOREIGN KEY (vj_users_preferences_id)
    REFERENCES VJ_USER_PREFERENCES(ID)
  );
  
  CREATE TABLE B(
    ID NUMBER(10) NOT NULL,
    EXT_ID NUMBER(10) NOT NULL,
    KEY VARCHAR2(1024) NOT NULL,
    VALUE VARCHAR2(1024) NOT NULL,
    CONSTRAINT PK_B PRIMARY KEY(ID)
  );
  </code></pre>
  
  <p>For both tables I have entities and I want to map them @OneToOne. </p>
  
  <pre><code>class Entity A{
      .......
      @OneToOne(cascade = CascadeType.ALL)
      @JoinColumn(name="pk_b", referencedColumnName = "id")
      private B b;
  }
  </code></pre>
  
  <p>Entity B is Audited and haven't got A field so connection is unidirectional. When I try to persist the A entity I got the error:</p>
  
  <blockquote>
    <p>Caused By: org.hibernate.HibernateException: Could not determine type of dynamic map entity</p>
  </blockquote>
  
  <p>This exception is being thrown from:</p>
  
  <blockquote>
    <p>org.hibernate.tuple.entity.DynamicMapEntityTuplizer.BasicEntityNameResolver#resolveEntityName</p>
  </blockquote>
  
  <p>Because the input is Map and it has not got: DynamicMapInstantiator.KEY in it.</p>
  
  <p>Can somebody help me with this issue? I cannot figure out why Hibernate is creating that map without necessary value. Is there something wrong with my mapping? </p>