I have an abstract base entity class which is annotated with @MappedSuperclass and used as the superclass for @Entity objects like so:
@Code:@MappedSuperclass @RooJavaBean @RooToString public abstract class AbstractEntity implements Serializable { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_GENERATOR") @Column(name = "ID", length = 10, unique = true, updatable = false, nullable = false) private Long id; @Version @NotNull @Column(name = "UPDATE_DATE", length = 7, nullable = false) private Timestamp updateDate = new Timestamp(new Date().getTime()); @NotNull @Temporal(TemporalType.TIMESTAMP) @Column(name = "CREATE_DATE", length = 7, nullable = false) private Date createDate; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Timestamp getUpdateDate() { return updateDate; } public void setUpdateDate(Timestamp updateDate) { this.updateDate = updateDate; } }Code:Entity @RooEntity @RooJavaBean @RooToString @Table(schema = "ENVAUDIT", name = "EA_RANK") @SequenceGenerator(name = "SEQUENCE_GENERATOR", sequenceName = "ENVAUDIT.EA_RANK_S") @AttributeOverride(name="id", column=@Column(name = "EA_RANK_ID", length = 10, unique = true, updatable = false, nullable = false)) public class Rank extends AbstractEntity { @NotNull @Size(max = 2) @Column(name = "EA_RANK_CODE", length = 2, nullable = false) private String code; @NotNull @Size(max = 4000) @Column(name = "EA_RANK_DESC", length = 4000, nullable = false) private String description; }Given this setup Roo is showing the following error message:Code:@Entity @RooEntity @RooJavaBean @RooToString @Table(schema = "ENVAUDIT", name = "EA_CYCLE") @SequenceGenerator(name = "SEQUENCE_GENERATOR", sequenceName = "ENVAUDIT.EA_CYCLE_ID_SEQ") @AttributeOverride(name="id", column=@Column(name = "CYCLE_ID", length = 10, unique = true, updatable = false, nullable = false)) public class Cycle extends AbstractEntity { @NotNull @Size(max = 100) @Column(name = "CYCLE_DESC", length = 100, nullable = false) private String description; @NotNull @Temporal(TemporalType.TIMESTAMP) @Column(name = "CYCLE_BEGIN_DATE", length = 7, nullable = false) private Date beginDate; @NotNull @Temporal(TemporalType.TIMESTAMP) @Column(name = "CYCLE_END_DATE", length = 7, nullable = false) private Date endDate; @NotNull @Column(name = "CYCLE_ACTIVE_IND", length = 1, nullable = false) @Type(type="yes_no") private Boolean active; }
User provided @javax.persistence.Id field but failed to provide a public 'getId()' method in 'Rank'
I believe this error might also be preventing Roo from updating other generated files. For instance I have added the modifyCycle method to my CycleDataOnDemand.java file and Roo has not removed the the corresponding method from the CycleDataOnDemand_Roo_DataOnDemand.aj file.
I wasn't sure if this was a bug in Roo or something I am doing wrong so I didn't create an issue in Jira.
Note: Without adding the modifyCycle() method to the .java file all of the integration tests passed when doing "mvn clean test".
Note: I am using Roo version 1.0.0.M1 because my organization's proxy or virus scanner is blocking me from downloading the prepared zip files and I have to make a special request to our networks team to get the files so I have been holding off for now because of the hassle (perhaps until RC1).


Reply With Quote
