-->
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: using Annotations without changing existing class?
PostPosted: Thu Mar 31, 2011 2:55 pm 
Newbie

Joined: Thu Mar 31, 2011 2:24 pm
Posts: 1
I just got handed an existing application with POJOs in it. For non-technical reasons, I can't annotate the POJOs, and I need to write a quick-and-dirty throwaway that is read only. Was going to use Hibernate (or Hibernate and Spring).

I can do an XML configuration, but something is sticking in the back of mind that there was a way to Annotate a new class that was similar to the existing class and have the annotations take effect.

something like this....

Code:
public Foo {
Integer key;
String bar;
public Integer getKey() { return key; }
public Integer setKey(int k) { key = k; }
public String getBar() { return bar; }
public void setBar (String b) { bar = b; }
}

@Entity (realClass="Foo")
@Table (name="Foo")
public FakeFoo {
@Id
@Column(name="IKEY")
public Integer key;
@Column(name="FBAR")
public String bar;
}

Is that a Hibernate (or Hibernate+Spring) feature, or is my memory dredging up something else? I've researched it pretty hard, can't seem to find it....


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.