I would like to modify reveng to add some methods


#1

I would like to generate a getter and a setter for the foreign key value in addition to the classes.

Although Stackoverflow shows the annotations on the attribute

AtSign Column(name=“message_key”, updatable=false, insertable=false)
private Long message_fk;

Reveng generates them on the getter.

Following the current pattern I would like to generate:

   AtSign Column(name="APS_SRC_RULE_SET_NBR", nullable=false, insertable = false, updatable = false)
    public Integer getApsSrcRuleSetNbr() {
            return apsSrcRuleSetNbr;
    }

In addition to the currently generated:

AtSignManyToOne(fetch=FetchType.LAZY)
AtSign JoinColumn(name=“APS_SRC_RULE_SET_NBR”, nullable=false)
public ApsSrcRuleSet getApsSrcRuleSet() {
return this.apsSrcRuleSet;
}

This appears to need changes to

orm/src/main/java/org/hibernate/tool/internal/export/pojo
BasicPOJOClass.java
EntityPOJOClass.java

as well as PojoPropertyAccessors.ftl

I would also like to generate

a constructor that takes a map as an argument attributeName, value.

LinkedHashMap<String,Object> mappedValues toMap()
method

I think it would be easiest for fork the orm project on github, if someone would like to look at my modifications and guide me in the right direction.

I would also like to contribute to an enhancment to directed eager fetches so that multiple cursors are not generated based but I will reserve that discussion until there is some interest in that area.

I will now modify this until I can get it to post, I haven’t mentioned any users and I am getting a “new users can only mention two users in a post” error although I have mentioned no one. It’s probably the at sign on annotations,


#2

I moved the discussion to the Hibernate Tools channel.