Not sure which forum to post this in, so I'll post it here....
So, is there any idea from anyone whether or when hbm2java will get suppot for the new generics in JDK 1.5 (now publicly out in beta)?
I don't know quite what it would look like -- and it'll be a pain getting the syntax right in mapping files -- but maybe something like:
Code:
<class name="com.nimblefish.core.data.Client">
<id name="id" type="long" unsaved-value="null" >
<generator class="native"/>
</id>
<property name="name" type="string"/>
<set name="campaigns" inverse="true" cascade="all-delete-orphan">
<key column="client_id"/>
<one-to-many class="com.nimblefish.core.data.Campaign"/>
</set>
</class>
resulting in:
Code:
/** @author Hibernate CodeGenerator */
public class Client implements Serializable {
/** identifier field */
private Long id;
/** nullable persistent field */
private String name;
/** persistent field */
private Set<Campaign> campaigns;
/** full constructor */
public Client(String name, Set<Campaign> campaigns) {
this.name = name;
this.campaigns = campaigns;
}
/** default constructor */
public Client() {
}
/** minimal constructor */
public Client(Set<Campaign> campaigns) {
this.campaigns = campaigns;
}
etc.?????
I know, I know, you'd love to get patches through JIRA :-) Hmm... maybe that'd be a fun project to work on... add some kind of meta attribute="generate-generics" or something?
Has anyone been thinking about and/or working on this yet? And would there be issues in getting the Hibernate runtime to play nicely with generics?
Cheers!
Rob