spring - JDO class persistence for DB connection -
i new
org.datanucleus.store.rdbms.query.jdoqlquery.compilequeryfull query candidates of com.titas.model.user_login , subclasses resulted in no possible candidates persistent class "com.titas.model.user_login" has no table in database, operation requires it. please check specification of metadata class. org.datanucleus.store.rdbms.exceptions.notablemanagedexception: persistent class "com.titas.model.user_login" has no table in database, operation requires it. please check specification of metadata class. @ org.datanucleus.store.rdbms.rdbmsstoremanager.getdatastoreclass (rdbmsstoremanager.java:693) @ org.datanucleus.store.rdbms.query.rdbmsqueryutils.getstatementfor candidates(rdbmsqueryutils.java:425)
my dispatcher servlet is:
<!-- pmf bean --> <bean id="mypmf" class="org.springframework.orm.jdo.localpersistencemanagerfactorybean"> <property name="jdopropertymap"> <props> <prop key="javax.jdo.persistencemanagerfactoryclass">org.datanucleus.api.jdo.jdopersistencemanagerfactory</prop> <prop key="javax.jdo.option.connectiondrivername">com.mysql.jdbc.driver</prop> <prop key="javax.jdo.option.connectionurl">jdbc:mysql://localhost:3306/login</prop> <prop key="javax.jdo.option.connectionusername">root</prop> <prop key="javax.jdo.option.nontransactionalread">true</prop> <prop name="javax.jdo.option.nontransactionalwrite" value="true"></prop> <prop key="javax.jdo.option.retainvalues">false</prop> <prop key="javax.jdo.option.detachalloncommit">true</prop> <prop key="javax.jdo.option.multithreaded">true</prop> </props> </property> </bean> <!--<bean id="pmfproxy" class="org.springframework.orm.jdo.transactionawarepersistencemanagerfactoryproxy"> <property name="targetpersistencemanagerfactory" ref="mypmf"/> <property name="allowcreate" value="false"/> </bean> --> <bean id="txmanager" class="org.springframework.orm.jdo.jdotransactionmanager"> <property name="datasource" ref="datasource"/> <property name="persistencemanagerfactory" ref="mypmf"/> </bean> <bean id="userdao" class="com.titas.dao.userdaoimpl" > </bean>
daoimpl:
@autowired @qualifier("datasource") private datasource datasource; @autowired @qualifier("mypmf") private persistencemanagerfactory pmf; httpservletrequest request; @override @transactional public list<user_login> getuser(string username, string userpassword) { persistencemanager pm = this.pmf.getpersistencemanager(); transaction tx = pm.currenttransaction(); jdopersistencemanager jdopm = (jdopersistencemanager)pm; try { // start transaction tx.begin(); typesafequery<user_login> tq = jdopm.newtypesafequery(user_login.class); quser_login user = quser_login.candidate(); list<user_login> result = tq.filter(user.user_name.eq(username).and(user.user_password.eq(userpassword))).executelist(); if(result.size()>0){ log.info(">>>>>00000000"); }else{ log.info("<<<<<<<=====000000"); } // commit transaction, flushing object datastore tx.commit(); return result; } { if (tx.isactive()) { // error occurred rollback transaction tx.rollback(); } pm.close(); }
user.java:
@persistencecapable(table = "user_login") public class user_login { @primarykey @column(name="user_id") private integer user_id=0; @column(name="user_profile_name") private string user_profile_name=null; @column(name="user_email") private string user_email=null; @column(name="user_contact") private string user_contact=null; @column(name="user_name") private string user_name=null; @column(name="user_password") private string user_password=null; @column(name="user_role_id") private integer user_role_id=0;
my dependencies are: datanucleus-core, datanucleus-rdbms, datanucleus-api-jdo, datanucleus-jdo-query, jdo-api
table recognition db failure. not sure persistence. please help!!
Comments
Post a Comment