Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kundera JPA no support AccessType.PROPERTY when I used mongodb store #341

Closed
samwencn opened this issue Aug 1, 2013 · 2 comments
Closed
Labels

Comments

@samwencn
Copy link

samwencn commented Aug 1, 2013

@entity
@table(name="p1",schema="kundera@kundera_mongo_pu" )//schema="kundera@kundera_mongo_pu"
@access(AccessType.PROPERTY)
public class P1 implements Serializable{

/**
 * 
 */
private static final long serialVersionUID = -3861925441255623432L;
private String id;
private String productname;
private Date createDate;
private Integer type;
@Id
public String getId() {
    return id;
}
public void setId(String id) {
    this.id = id;
}
@Column
public String getProductname() {
    return productname;
}
public void setProductname(String productname) {
    this.productname = productname;
}
@Column
public Date getCreateDate() {
    return createDate;
}
public void setCreateDate(Date createDate) {
    this.createDate = createDate;
}
@Column
public Integer getType() {
    return type;
}
public void setType(Integer type) {
    this.type = type;
}
@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((id == null) ? 0 : id.hashCode());
    return result;
}
@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (obj == null)
        return false;
    if (getClass() != obj.getClass())
        return false;
    P1 other = (P1) obj;
    if (id == null) {
        if (other.id != null)
            return false;
    } else if (!id.equals(other.id))
        return false;
    return true;
}

}

//persistence.xml

com.impetus.kundera.KunderaPersistence
com.samtech.jpa.domain.P1
















//persist object exception
2013-8-1 22:01:38 org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean createNativeEntityManagerFactory
信息: Building JPA container EntityManagerFactory for persistence unit 'kundera_mongo_pu'
2013-8-1 22:01:38 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@10f11b8: defining beans [p1Dao,entityManagerFactory]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:922)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
at com.samtech.jpa.base.dao.P1Dao.main(P1Dao.java:38)
Caused by: java.lang.NullPointerException
at com.impetus.kundera.configure.MetamodelConfiguration.processGeneratedValueAnnotation(MetamodelConfiguration.java:490)
at com.impetus.kundera.configure.MetamodelConfiguration.scanClassAndPutMetadata(MetamodelConfiguration.java:399)
at com.impetus.kundera.configure.MetamodelConfiguration.loadEntityMetadata(MetamodelConfiguration.java:230)
at com.impetus.kundera.configure.MetamodelConfiguration.configure(MetamodelConfiguration.java:102)
at com.impetus.kundera.configure.Configurator.configure(Configurator.java:65)
at com.impetus.kundera.KunderaPersistence.initializeKundera(KunderaPersistence.java:109)
at com.impetus.kundera.KunderaPersistence.createEntityManagerFactory(KunderaPersistence.java:81)
at com.impetus.kundera.KunderaPersistence.createContainerEntityManagerFactory(KunderaPersistence.java:65)

@mevivs
Copy link
Collaborator

mevivs commented Aug 1, 2013

#24

Support is very much on card, needs to be planned.

-Vivek

@mevivs
Copy link
Collaborator

mevivs commented Apr 23, 2014

Closing it. Continue tracking with #24

@mevivs mevivs closed this as completed Apr 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants