aspose file tools*
The moose likes Object Relational Mapping and the fly likes InvalidMappingException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "InvalidMappingException" Watch "InvalidMappingException" New topic
Author

InvalidMappingException

shwitzu ann
Greenhorn

Joined: Oct 24, 2009
Posts: 8

Hello friends,

I am getting the following when I was trying to run my hibernate code. Please help me!





customer.hbm.xml


Vivek Singh
Ranch Hand

Joined: Oct 27, 2009
Posts: 92
Post your pojo also ? it will be easier to debug then
shwitzu ann
Greenhorn

Joined: Oct 24, 2009
Posts: 8
posted the pojo below
Vivek Singh
Ranch Hand

Joined: Oct 27, 2009
Posts: 92
Your Customer class doesn't have a property named as nameStyle... Add Setter and getters and add the column in table also.

Wow!!! i asked only for your Customer class Pojo....Not 3000 lines of code.... Its impossible to read such code...Please Edit it.....
shwitzu ann
Greenhorn

Joined: Oct 24, 2009
Posts: 8
Sorry for the trouble.. removed all the comments... please find the code. My class is that big.

shwitzu ann
Greenhorn

Joined: Oct 24, 2009
Posts: 8
Just now I verified the customer class. It has got nameStyle in it.
Vivek Singh
Ranch Hand

Joined: Oct 27, 2009
Posts: 92
nameStyle, firstName ,lastName everthing is in customerInfo class.
So in your mapping file change it to:-


Thats a inner class.
shwitzu ann
Greenhorn

Joined: Oct 24, 2009
Posts: 8
Hello! I changed it accordingly but still its trowing the same.


Vivek Singh
Ranch Hand

Joined: Oct 27, 2009
Posts: 92
VivekSingh SinghVivek wrote:nameStyle, firstName ,lastName everthing is in customerInfo class.
So in your mapping file change it to:-


Thats a inner class.


Sorry there was a mistake it should be.


Change the name of mapping file also so to keep with standards to CustomerInfo.hbm.xml .
Make the same change in your hibernate.cfg.xml
shwitzu ann
Greenhorn

Joined: Oct 24, 2009
Posts: 8
Hello I guess there is some problem still.

Vivek Singh
Ranch Hand

Joined: Oct 27, 2009
Posts: 92
hey check this Inner Class Mapping

Its not able to find the inner class. This might help you!!!
Vivek Singh
Ranch Hand

Joined: Oct 27, 2009
Posts: 92
check this also
 
 
subject: InvalidMappingException