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....