-->
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.  [ 1 post ] 
Author Message
 Post subject: Redefine a column / Deliberate "Duplicate property mapping"
PostPosted: Fri Aug 12, 2011 11:24 am 
Newbie

Joined: Fri Aug 12, 2011 11:12 am
Posts: 1
We need to extend/subclass a Entity/MappedSuperclass from a library with our web framework's validation annotations. I'm near certain your framework makes this impossible, but I thought I'd ask. Here's what we wish to do:

Code:
@Entity
@Table(name="Person")
public class WebPerson extends Person {
   @Override
   @Validate("require")
   public String getName() { return super.getName(); }
}


Pretty basic: override an existing column, with the new override having an additional annotation on it.

I'm pretty sure this behavior— overriding a column— is not possible. Here's the stack that's thrown:
Code:
org.hibernate.MappingException: Duplicate property mapping of queryName found in us.catalist.ngqt.entities.NgqtQuery
   at org.hibernate.mapping.PersistentClass.checkPropertyDuplication(PersistentClass.java:477)
   at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:467)
   at org.hibernate.mapping.RootClass.validate(RootClass.java:215)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:1135)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1320)
   at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)


Anyone know any neat tricks to try? I've tried extending an existing Entity and a MappedSuperclass, same MappingException for both. :(

-rektide


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

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.