hibernateexception - Unknown Entity using Spring and hibernate -


i struggling wit error hours now.i know simple configuration somehow not work me.

here relevant portion of applicationcontext.xml :-

     <bean id="sessionfactory" class="org.springframework.orm.hibernate3.annotation.annotationsessionfactorybean">     <property name="datasource"><ref local="datasource"/></property>     <property name="configurationclass">         <value>org.hibernate.cfg.annotationconfiguration</value>     </property>     <property name="packagestoscan" value="com.xxx.pkit.entities"/>   <property name="hibernateproperties">         <props>              <prop key="hibernate.show_sql">true</prop>             <prop key="hibernate.dialect">                 org.hibernate.dialect.oracle9dialect             </prop>             <prop key="connection.pool_size">10</prop>             </props>   </property>   </bean> 

i have used both "annotatedclasses" , "packagestoscan" no avail.here entity class.

          package com.xxx.pkit.entities;     import java.io.serializable;    import java.util.date;     import javax.persistence.column;    import javax.persistence.entity;    import javax.persistence.id;    import javax.persistence.table;    import javax.persistence.temporal;    import javax.persistence.temporaltype;     @suppresswarnings("serial")    @entity   @table(name = "document_details")   public class documentdetails extends genericentity implements serializable{  @column(name = "document_url") private string documenturl ;  @column(name = "tagged_by") private string taggedby ;   @temporal(temporaltype.timestamp) @column(name = "date_submitted") private date datesubmitted ;  @column(name = "primary_tag") private string primarytag ;  @column(name = "primary_tag_path") private string primarytagpath ;  @id @column(name = "document_details_id") private long documentdetailsid ;  public string getdocumenturl() {     return documenturl; }  public void setdocumenturl(string documenturl) {     this.documenturl = documenturl; }  public string gettaggedby() {     return taggedby; }  public void settaggedby(string taggedby) {     this.taggedby = taggedby; }  public date getdatesubmitted() {     return datesubmitted; }  public void setdatesubmitted(date datesubmitted) {     this.datesubmitted = datesubmitted; }  public string getprimarytag() {     return primarytag; }  public void setprimarytag(string primarytag) {     this.primarytag = primarytag; }  public string getprimarytagpath() {     return primarytagpath; }  public void setprimarytagpath(string primarytagpath) {     this.primarytagpath = primarytagpath; }  public long getdocumentdetailsid() {     return documentdetailsid; }  public void setdocumentdetailsid(long documentdetailsid) {     this.documentdetailsid = documentdetailsid; } 

}

problem appears when try save in entity.here exception stack trace :-

  org.hibernate.mappingexception: unknown entity: com.xxx.pkit.entities.document    details    @ org.hibernate.impl.sessionfactoryimpl.getentitypersister(sessionfacto    ryimpl.java:550)     @ org.hibernate.impl.sessionimpl.getentitypersister(sessionimpl.java:13     38)     @ org.hibernate.event.def.abstractsaveeventlistener.savewithgeneratedid (abstractsaveeventlistener.java:98)     @ org.hibernate.event.def.defaultsaveorupdateeventlistener.savewithgene       ratedorrequestedid(defaultsaveorupdateeventlistener.java:187)     @ org.hibernate.event.def.defaultsaveeventlistener.savewithgeneratedorr 

any appreciated - please save time.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -