Hello,
I have a simple setup with hibernate entity manager and a Derby database instance.
I have this simple entity class:
Code:
@Entity
public class Entity
{
private long id;
private String name;
@Id
public long getId()
{
return id;
}
public void setId(long id)
{
this.id = id;
}
@Index(name="idx")
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
}
When the table is auto created by hibernate, there is no index for the name column:
Code:
ij> describe entity;
COLUMN_NAME |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
------------------------------------------------------------------------------
ID |BIGINT |0 |10 |19 |NULL |NULL |NO
NAME |VARCHAR |NULL|NULL|255 |NULL |510 |YES
2 rows selected
ij> show indexes from entity;
TABLE_NAME |COLUMN_NAME |NON_U&|TYPE|ASC&|CARDINA&|PAGES
----------------------------------------------------------------------------
ENTITY |ID |false |3 |A |NULL |NULL
Any help please? I guess I am missing something pretty simple.
Thanks
Neil