These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Problems with subclass
PostPosted: Thu Jul 27, 2006 6:52 am 
Beginner
Beginner

Joined: Thu Jun 22, 2006 8:56 am
Posts: 22
Hello,

i have this error:
The content of element type "subclass" must match "(meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|idbag|array|primitive-array)*,join*,subclass*,loader?,sql-insert?,sql-update?,sql-delete?,resultset*,(query|sql-query)*)".

my subclass element:

Quote:
<subclass name="Source" discriminator-value="source">
<id name="id" column="id">
<generator class="native"/>
</id>
<property type="string" name="link" column="url" not-null="true" />
</subclass>


What is wrong here?ยด

Thank you,

greetings,

seven-12


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 7:08 am 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
the id element. A subclass shares the id with the class

HTH,
Radu


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 7:19 am 
Beginner
Beginner

Joined: Thu Jun 22, 2006 8:56 am
Posts: 22
Thank you,

should i remove this id ?

when i do it i get :occurred calling getter of Source.id.

protected Integer id;
public Integer getId() {
return id;
}


could you please help me?

thank you,

seven-12


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 7:25 am 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
of course you should remove the getter as you already should have one in the base class.


Cheers,
Radu


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 7:33 am 
Beginner
Beginner

Joined: Thu Jun 22, 2006 8:56 am
Posts: 22
hmm,

i did it, but i still have this problem;
Exception in thread "main" org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of Source.id

Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 7:45 am 
Beginner
Beginner

Joined: Thu Jun 22, 2006 8:56 am
Posts: 22
when i comment out thos subclass element i dont have this error...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 09, 2006 4:01 pm 
Newbie

Joined: Mon Aug 07, 2006 6:40 pm
Posts: 12
Location: Atlanta, GA
looking at the
Quote:
<subclass name="Source" discriminator-value="source">


I think you need to:

[1] make sure the name is a fully-qualified .NET class name, such as:

<subclass name="MyNamespace.Source, MyAssembly" discriminator-value="source">

[2] The <subclass>...</subclass> is either contained in your parent class or specified an extends attribute with the fully-qualified .NET class name of the parent class

[3] You will need a <discriminator> in the parent class (immediately after the id element) that designates the column that the discrimator-value in the subclass is found in.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.