Problem with Studio 7 -> Colum was switched to Date?

Hi,

I came across a strange problem right now:
In one entity, he switched the type to Date so some scripts are created to rename/drop a column and create it again as a Date column.

But of course: This does not make any sense at all!

Inside the editor of the entity, I cannot change the type.

When I edit the entity, then the change is reversed as soon as I switch to designer and back to the text.

So the code that Studio creates inside the entity is always:

@Temporal(TemporalType.DATE)
@Column(name = "COVERTEXT")
protected Date covertext;

public void setCovertext(Date covertext) {
    this.covertext = covertext;
}

public Date getCovertext() {
    return covertext;
}

And I am editing it to:

@Lob
@Column(name = "COVERTEXT")
protected String covertext;

public void setCovertext(String covertext) {
    this.covertext = covertext;
}

public String getCovertext() {
    return covertext;
}

But as soon as I open Designer and go back to the text: It was changed back!

Sorry, but this is really critical. Of course: The fields never ever have Dates inside, I do not want dates, applying such a change would result in a data loss.

So I am really wondering why Studio wants to have 2 fields as date fields and what I have to do to revert this.
All I did was adding some read only Transient properties to the entity with calculated values. But these didin’t involve the properties wich was changed now.

Would be great if I could get help on this issue quickly. Else I have to drop studio 7, revert the source back to the last Studio 6 version and redo all changes on Studio 6 which I did on Studio 7.

With kind regards,

Konrad

I can post an update on this issue.

The issue happened with Studio 7.0. I saw that studio 7.2 was released, so I tried the new version.

a) On the broken code (with the wrong Date type inside my entity), I simply edited the code of the entity as described in my first post and this time, when switching to the designer, the designer showed the type correctly and the code wasn’t changed back.

b) But the designer shows the type of a column as read only. So the Type row shows the type with a drop down but the control is greyed out.

I also copied the source of the studio 6 version and opened it:
I was unable to change a type in there. (The types was correct, so there was no need to change anything, but topic b) is also valid here: The type couln’t be changed.)

I did some tests regarding the other issue with the update scripts, but I found no issue with Studio 7.2 regarding the create database and update database tasks.

So not sure what broke my solution in Studio 7.0, but that seems to be gone. But there seems to be a general issue regarding modification of the Data Model regarding changing the type of a column.

With kind regards,

Konrad

Hi @KonradN!

Attribute type can only be changed through IDEA functionality, this is a safer way to change the type.
Or from designer
image
Or from source editor - ‘Type Migration’ action (Refactoring -> Type Migration or Ctrl + Shift + F6)

Hi,

sorry for my late response.

Ok, soin the new version, only the refactoring method is offered. That is ok for me and I can work that way.

(Main reason for my posting was this strange behaviour describes in a) which I was really wondering about. But I never got that strange behaviour in later tests,)

With kind regards,

Konrad