Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not able to resolve the error "entity class not found: employee"

 
Nikhil Muskur
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i a newbie in ORM and i followed a tutorial for a basic hibernate application all my classes are in proper packages my mapping class is employee.java and the logic class is start.java i have configured everything correctly but still i am getting this error

why is this so
and this my directory
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.lang.ClassNotFoundException: employee

You don't really have a class that's not in a package, and which starts with a lowercase letter, do you?
 
Nikhil Muskur
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:
java.lang.ClassNotFoundException: employee

You don't really have a class that's not in a package, and which starts with a lowercase letter, do you?

Ya do have that class in my hib package..........and didn't get you..... did you mean the naming convention.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do have that class in my hib package

So it *is* in a package? In that case, make sure to use the fully-qualified class name (including the package name) wherever you refer to the class. Apparently, you refer to it somewhere as "employe" instead of "hib.employee".

And yes, if you don't want to confuse peeple reading your code you should use the standard Java naming conventions. Class names start in uppercase, field and method name in lowercase, constants in all-uppercase etc.
 
Nikhil Muskur
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:
do have that class in my hib package

So it *is* in a package? In that case, make sure to use the fully-qualified class name (including the package name) wherever you refer to the class. Apparently, you refer to it somewhere as "employe" instead of "hib.employee".

And yes, if you don't want to confuse peeple reading your code you should use the standard Java naming conventions. Class names start in uppercase, field and method name in lowercase, constants in all-uppercase etc.

oh sorry forgot for default package we need not mention the package name .........for other we have to mention the package name ...Thank you problem solved
And can you suggest some book for Hibernate as the hibernate documentation is little tough to understand...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic