Announcement Announcement Module
Collapse
No announcement yet.
How to debug hibernate "is not mapped" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to debug hibernate "is not mapped"

    I have to integrate with a library of domain classes that contain @Entity annnotations. For example:
    Code:
    @Entity
    @Table (name="physician")
    public class Physician {
    
    	@Column (name="specialty")
    	public String getSpecialty() {
    		return specialty;
    	}
    I copied the Physician class to a local test project and changed the package to be my local test project. Everything worked fine. When I try to access the actual library by setting the package in the 'packagesToScan' attribute of the session factory I get
    Code:
    org.hibernate.hql.ast.QuerySyntaxException: Physician is not mapped [FROM  Physician]
    Code:
    	<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
    				 p:dataSource-ref="dataSource"
    				 p:configLocation="${hibernate.config}"
    				 p:packagesToScan="com.medlibrary.domain.**.*, com.mycompany.myapp " />
    I don't see anything about Physician being mapped in the log files but I have to assume Hibernate knows what it's talking about. What should I look for to determine what is not happening in the mapping department?

    -=bils
Working...
X