title: NPE on ManyToMany in DataNucleus
body: <p>I have this entity</p>
  
  <pre><code>@Entity
  public class ContactList extends Base {
  
      private static final long serialVersionUID = BaseEntity.serialVersionUID;
  
      @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
      private Collection&lt;User&gt; contacts = new HashSet&lt;User&gt;();
  
      public ContactList() {
      }
  
      public Collection&lt;User&gt; getContacts() {
          return contacts;
      }
  
      public void setContacts(Collection&lt;User&gt; contacts) {
          this.contacts = contacts;
      }
  
  }
  </code></pre>
  
  <p>and whatever method I call from the Spring Data repository, like <code>findAll()</code>, I get this error</p>
  
  <pre><code>java.lang.NullPointerException: null
  at org.datanucleus.store.rdbms.RDBMSStoreManager.assertCompatibleFieldType(RDBMSStoreManager.java:1005) ~[datanucleus-rdbms-4.1.1.jar:na]
  at org.datanucleus.store.rdbms.RDBMSStoreManager.getBackingStoreForField(RDBMSStoreManager.java:965) ~[datanucleus-rdbms-4.1.1.jar:na]
  at org.datanucleus.store.rdbms.query.BulkFetchExistsHelper.getSQLStatementForContainerField(BulkFetchExistsHelper.java:93) ~[datanucleus-rdbms-4.1.1.jar:na]
  at org.datanucleus.store.rdbms.query.JPQLQuery.compileQueryFull(JPQLQuery.java:894) ~[datanucleus-rdbms-4.1.1.jar:na]
  at org.datanucleus.store.rdbms.query.JPQLQuery.compileInternal(JPQLQuery.java:296) ~[datanucleus-rdbms-4.1.1.jar:na]
  at org.datanucleus.store.query.Query.executeQuery(Query.java:1801) ~[datanucleus-core-4.1.1.jar:na]
  at org.datanucleus.store.query.Query.executeWithMap(Query.java:1747) ~[datanucleus-core-4.1.1.jar:na]
  at org.datanucleus.api.jpa.JPAQuery.getResultList(JPAQuery.java:197) ~[datanucleus-api-jpa-4.1.1.jar:na]
  at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:77) ~[spring-data-jpa-1.3.0.RELEASE.jar:na]
  at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:55) ~[spring-data-jpa-1.3.0.RELEASE.jar:na]
  at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:95) ~[spring-data-jpa-1.3.0.RELEASE.jar:na]
  at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:85) ~[spring-data-jpa-1.3.0.RELEASE.jar:na]
  at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:312) ~[spring-data-commons-1.5.0.RELEASE.jar:na]
  </code></pre>
  
  <p>Any idea why?</p>
  
  <p>I also tried adding <code>targetEntity = User.class</code> to @ManyToMany.
  I'm using DataNucleus 1.4.1.</p>
  
  <p>I found in the log the following lines that could be relevant:</p>
  
  <pre><code>DataNucleus.Datastore.Schema - DEBUG: Field [ContactList.contacts] -&gt; Column(s) [contactlist.contacts] using mapping of type "org.datanucleus.store.rdbms.mapping.java.TypeConverterMapping" (org.datanucleus.store.rdbms.mapping.datastore.VarCharRDBMSMapping) 
  ...
  DataNucleus.Persistence - WARN : Member ContactList.contacts in table=contactlist has mapping=org.datanucleus.store.rdbms.mapping.java.TypeConverterMapping@6296ccf7 but expected mapping type=class org.datanucleus.store.rdbms.mapping.java.CollectionMapping 
  </code></pre>