File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Duplicate collection role mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Duplicate collection role mapping" Watch "Duplicate collection role mapping" New topic
Author

Duplicate collection role mapping

Ashish Yannam
Greenhorn

Joined: Sep 05, 2007
Posts: 19
Hi,

I am trying to map two tables having one-many relationship.


This is my mapping file for the "one side";

I am getting the following exception



can anyone please help
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9329
    
110

This might be one possible reason.


[My Blog] [JavaRanch Journal]
Ashish Yannam
Greenhorn

Joined: Sep 05, 2007
Posts: 19
I am building a standalone application using eclipse.

can you help me with that.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

My guess is that you have used the Cooks class twice somewhere, or even more likely, you have two mapping files for the Cooks class. Check for duplicate entries in your hibernate configuration file.

Show us your mappings element of the configuration file if you're still having problems.

-Cameron McKenzie
Ashish Yannam
Greenhorn

Joined: Sep 05, 2007
Posts: 19
I am putting up the mapping files here for Customer and the Book
I want a one to many relationship between the Customer and Book.

Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Are we talking about cooks or books?

-Cameron McKenzie
Ashish Yannam
Greenhorn

Joined: Sep 05, 2007
Posts: 19
It was an typing mistake there.
The name of the set is books, and am having getter and setter methods in the Customer class as
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Duplicate collection role mapping
 
Similar Threads
InvalidMappingException
Duplicate collection role mapping
duplicate Mapping Exception : duplicate collection role mapping
Duplicate class/entity mapping error
help: Duplicate mapping exception