EJB3 annotation generation


#1

In Modelling-Options-Eclipse i select “Genarate EJB Annotation on Field”,but annotations are generated both on Field and on getter operation. Why?



@javax.persistence.Entity
public class BASE_STATION implements java.io.Serializable {

 @javax.persistence.Column(name = "SIGN_TRAIN_WORK", length = 1)
 private Character sign_train_work;

 @javax.persistence.Column(name = "SIGN_TRAIN_WORK", length = 1)
 public Character getSign_train_work() {
  return sign_train_work;
 }
 public void setSign_train_work(Character value) {
  sign_train_work = value;
 }
 @javax.persistence.Column(name = "ST_TYPE", length = 1)
 private Character st_type;

 @javax.persistence.Column(name = "ST_TYPE", length = 1)
 public Character getSt_type() {
  return st_type;
 }

 public void setSt_type(Character value) {
  st_type = value;
 }

}



#2

Hi Renat,

Thanks for your post. I’ve forwarded the issue to our engineers to investigate, I’ll come back to you once there is any news.

Best regards,
Lilian Wong


#3

And the second question:

I use SDE 5.0 for Eclipse Enterprise Edition. Annotations in EJB are generated with a full path:


package ejb;

@javax.persistence.Entity
public class OBJ_UNION implements java.io.Serializable {

 @javax.persistence.OneToOne(optional = false)
 @javax.persistence.PrimaryKeyJoinColumn(name = "ID_UNION", referencedColumnName = "ID_OBJ")
 Object ID_UNION;
...

I would like to register path in import section for use short style in code:


package ejb;
import javax.persistence.*

@Entity
public class OBJ_UNION implements java.io.Serializable {

 @OneToOne(optional = false)
 @PrimaryKeyJoinColumn(name = "ID_UNION", referencedColumnName = "ID_OBJ")
 Object ID_UNION;
...

Options of generation in “Modelling -Application Options - eclipse” never helped me.


#4

Hi Renat,

Thanks for replying. We are sorry that we do not support import for EJB code, but I’ve passed this issue to our development team to study the possibility to support it. I’ll keep you posted for any news on this issue.

Best regards,
Lilian Wong


#5

Hi Renat,

I would like to let you know that we will support import for EJB annotations in coming VP Suite 4.1 release (will be available on 21th September 2009). The import statement options at Tools > Options > Code Synchronization (see image) will determine to generate import for EJB annotations or not.

Our engineers are still working on the issue of generating EJB annotation on field.

Best regards,
Lilian Wong

import_options.png


#6

Hi Renat,

Sorry for my late response. We fixed the EJB annotation problem in VP Suite 4.1 SP1, please run “VP Suite Update” to update to latest patch (sp1_20091106b or later) for the fix. More details about updating to latest patch can be found from:

Best regards,
Lilian Wong