JPA exception: Object: … is not a known entity type

后端 未结 11 647

I\'m new to JPA and I\'m having problems with the autogeneration of primary key values.

I have the following entity:

package jpatest.entities;

impor         


        
11条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-10 03:02

    I ran into this same problem using NetBeans IDE 6.9.

    Apparently, this is a known issue. See http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_101:_20100218:_Descriptor.javaClass_is_null_on_a_container_EM_for_a_specific_case. Also see http://netbeans.org/bugzilla/show_bug.cgi?id=181068.

    I added the last line below to persistence.xml and it fixed it for me.

    org.eclipse.persistence.jpa.PersistenceProvider
    
    false
    

提交回复
热议问题