mysql - Why I cannot define an column named "index" in jpa? -
i use jpa persist object mysql databse.
when define column named "index" below, table not generated in database.
when delete or rename it, jpa works fine.
import java.util.date; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.id; import javax.persistence.table; import play.db.jpa.genericmodel; @entity @table(name="qa_assetvm") public class qaassetvm extends genericmodel{ private static final long serialversionuid = 1l; @id @column(name="vmassetname") public string vmassetname; @column(name="assetvm_index") //this works fine! public int index; /* @column(name="index") //when add this, table "qa_assetvm" not generated jpa in database. public int index; */ }
i haven't tried using mysql, 'index' seems reserved word.
check this out.
Comments
Post a Comment