add column in a table [message #630403] |
Fri, 01 October 2010 17:44  |
Eclipse User |
|
|
|
Hello everybody.
This is the first time i use eclipselink and i would like to know if i this plus JPA can create automatically a column into the database.
I mean:
class persona{
int id;
String name;
}
etc...(i haven't set the @stuff)
I want to know, if i modify this class (for, example adding a new field, eclipselink+JPA will modify my table or i have to use "alter table" methods.
I tried to do, but i'm receiving :
"Column DNI not found; SQL statement:" error.
|
|
|
Re: add column in a table [message #630556 is a reply to message #630403] |
Mon, 04 October 2010 02:05  |
Eclipse User |
|
|
|
AFAIK you can instruct JPA to automatically create tables, modifying I'm not sure. But personally I think databases are way to important to have them simply created by a library; I prefer using explicit SQL statements, so fields can be properly initialized, if required. If anything I'd use a library like liquibase.
Tom
On 1-10-2010 23:44, vicenrico wrote:
> Hello everybody.
> This is the first time i use eclipselink and i would like to know if i this plus JPA can create automatically a column into the database. I mean:
>
> class persona{
> int id;
> String name;
> }
>
> etc...(i haven't set the @stuff)
>
> I want to know, if i modify this class (for, example adding a new field, eclipselink+JPA will modify my table or i have to use "alter table" methods.
>
> I tried to do, but i'm receiving :
> "Column DNI not found; SQL statement:" error.
|
|
|
Powered by
FUDForum. Page generated in 0.03791 seconds