java - Spring/Hibernate/Flex = Unknown Entity -


i having bit of trouble spring+hibernate throwing error
org.springframework.orm.hibernate3.hibernatesystemexception: unknown entity: com.rottmanj.domain.user.useraccount; nested exception org.hibernate.mappingexception: unknown entity: com.rottmanj.domain.user.useraccount

i have debugged code , have researched issue, appears normal posted fixes issue not work me. appreciated.

i have dao should save correctly, instead throws error above.

@override public useraccount save(useraccount obj)  {     list<useraccount> userlist = template.findbyexample(obj);     try {         if (!userlist.isempty()) {             throw new exception(                     "a user these credentials exists. please try again.");         } else {             template.saveorupdate(obj);         }     } catch (exception e) {         logger.debug(e.tostring());     }      return obj; } 

this dao called service below, exposed remoting destination.

@service @remotingdestination(channels = { "my-amf" }) public class useraccountservice {  private useraccountdao dao = null; private static logger logger = logger.getlogger(useraccountservice.class);  @autowired public void setdao(useraccountdao dao) {     this.dao = dao; }  @remotinginclude public useraccount save(useraccount dataobject) {     return this.dao.save(dataobject); }  @remotinginclude public string test(string datastring) {     logger.debug(datastring.tostring());      return "this test " + datastring; } } 

my entity annotated there not use mapping files. have confirmed using correct annotation lib (import javax.persistence.entity)

package com.rottmanj.domain.user;  import java.util.hashset; import java.util.set; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.fetchtype; import javax.persistence.generatedvalue; import static javax.persistence.generationtype.identity; import javax.persistence.id; import javax.persistence.onetomany; import javax.persistence.table; import javax.persistence.uniqueconstraint;  @entity @table(name = "useraccount", uniqueconstraints = @uniqueconstraint(columnnames =     "username")) public class useraccount implements java.io.serializable {     ...entity cdoe } 

you still have specify in spring configuration file or hibernate mapping file existence of package (or class) scanning can happen. e.g. if using annotationsessionfactorybean spring, need include "packagestoscan" property indicate packages should scanned.

if done, can attach spring configuration files related hibernate?


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -