]
can any one help me find out what is this error all about please,I'm beginner.If this has some thing to do with the libraries or any other thing please suggest.I am using struts 2 for mvc and hibernate 3 for database connection and tomcat 7 as a web server.

Note: I generally avoid inheritance when it comes to Object-Relational mapping, so I could well be missing something else obvious around your use of an abstract base class.

aya Nouh

Greenhorn

Posts: 23

posted 10 months ago

All the codes contains the setters an the getters here is the code of AbstractCommande:

And the mapping file:

aya Nouh

Greenhorn

Posts: 23

posted 10 months ago

Dave Tolls wrote:

That seems to imply there's more than one mapping for this class.

Note: I generally avoid inheritance when it comes to Object-Relational mapping, so I could well be missing something else obvious around your use of an abstract base class.

I didn't understand, can you please give me more of explanations?

aya Nouh

Greenhorn

Posts: 23

posted 10 months ago

Mr Dave, Can I ask you something please?
Could you please give me your Email so I can send you all the code,and you'll have a clear view of my project
And you can then give me the remarks on the method I used for development??
it's difficult to post all the code here in the forum

Dave Tolls

Rancher

Posts: 3220

37

posted 10 months ago

Your attribute is called idUserr.
Your setter and getter are called setIduserr and getIduserr.

Those are incorrect, by bean naming standards. They need a capital 'U', not a lowercase one.

As for the duplicate:
Duplicate class/entity mapping com.app.hibernate.AstractArticleinCom

That's the class it thinks is duplicated, not the AbstractCommande one.

aya Nouh

Greenhorn

Posts: 23

posted 10 months ago

Dave Tolls wrote:For the first error:

The methods need to follow the Java Bean specification, so that should be:

Same issue with the setter.

Also check all the other getters/setters as I spot some others with the same issue.

As you told me before, the attributes should begin with a lowercase and in the setters and the getters we should use the first letter of the attribute in uppercase

aya Nouh

Greenhorn

Posts: 23

posted 10 months ago

I created a new project and copy/paste the code in the new project, now after authetification i have:

Dave Tolls

Rancher

Posts: 3220

37

posted 10 months ago

Not sure why you've gone down that route, but there's a jar file missing now.
The jta.jar I think?

Did you try and fix the naming issue with your code?

You had an attribute called:
idUserr
and a getter:
getIduserr

Similarly with the setter.

aya Nouh

Greenhorn

Posts: 23

posted 10 months ago

Hello, I fixed the probleme of duplicate mapping, now after authentification i have this:

aya Nouh

Greenhorn

Posts: 23

posted 10 months ago

And in the console window I have this:

Dave Tolls

Rancher

Posts: 3220

37

posted 10 months ago

That's telling you that the query is incorrect.
Specifically that it doesn't recognise 'users' as a mapped class.

aya Nouh

Greenhorn

Posts: 23

posted 10 months ago

Hello, can you help me please, I'm still having the same problem
this is the code on the classes:
AbstractUtilisateur.java:

Utilisateurs:

UtilisateursDAO:

GestionUtilisateur.java

I couldn't discover the problem

Dave Tolls

Rancher

Posts: 3220

37

posted 10 months ago

Utilisateurs is not mapped

So, is it mapped in the hibernate xml?
That would be the first place to look (as you are not using annotations).

aya Nouh

Greenhorn

Posts: 23

posted 10 months ago

here id the code of hibernate.cfg.xml:

And the code of Utilisateurs.hbm.xml:

Should I change something on the codes?? , I searched on the net and it seems to me correct..Should I use the class AbstractUtilisateur instead of Utilisateurs

Dave Tolls

Rancher

Posts: 3220

37

posted 10 months ago

That is mapping the abstract class, not the Utilisateur class.

aya Nouh

Greenhorn

Posts: 23

posted 10 months ago

Hello, Please can you explain to me why i have this erro after authentification: