EJB columnDefinition

Is it possible to specify the columnDefinition atttribute for the @Column annotation in VP-UML?

I want to have the following specification:


	@Column(name="create_date",columnDefinition="TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP", nullable=false)
	public Timestamp getCreate_date() {
		return this.create_date;
	}

But the code generated from Java round trip does not include columnDefinition.


	@Column(name="create_date", nullable=false)
	public Timestamp getCreate_date() {
		return this.create_date;
	}

I am creating the schema in ERD and syncing it to the class diagram and marking it with stereotype “Entity”. I have specified a default value in my ERD but it does not seem to carry through.

Any ideas?

I actually figured this out.

You use the “Java Annotations” tab in the attribute specification.

Specifing an existintg attribute name like “Column” simply appends whatever additional data you specify to the attribute tag already being generated.

The final output:


	@Column(columnDefinition="TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP", insertable=false, updatable=false, name="create_date", nullable=false)
	private Timestamp create_date;

It would be nice if these types of things were covered in the user manual, but that doesn’t appear to be the case.

Annotations.gif