Say that I have a java class with these fields(included only few fields, but the idea is that there could many more fields).
public class Entity {
private String firstName;
private String lastName;
private String costPrice;
private String sellingPriceForSomeItem;
}
Now I need to convert the above code to below code:
public class Entity {
@Column(name = "first_name")
private String firstName;
@Column(name = "last_name")
private String lastName;
@Column(name = "cost_price")
private String costPrice;
@Column(name = "selling_price_for_some_item")
private String sellingPriceForSomeItem;
}
Can we use macros to do this? Now in the above class, you see only 4 fields, but say that I have 100 such fields and I want to use some vi/vim way to speed up this process? How would one go about solving this? I am fine if we are unable to get the last field to work(i.e., fields with more than one camelCase word in it like sellingPriceForSomeItem).