As far as I know, RDBMS need an index to manage a FK. MySQL manual recommends users to create te index themselves, but if they don't it is created automatically. I believe this is valid for all DBs. If you're letting Hibernate create your tables, you could add the annotation @org.hibernate.annotations.Index. This is not in the standard EJB 3 API, I believe, because indexes are an exclusivity of relational databases; but you could have an object-oriented database or serialization (like with Prevayler) as the persistence engine. I think it wouldn't hurt to add an 'indexed' or 'indexName' attribute to @Column anyway, would it?
_________________ Henrique Sousa
Don't forget to rate useful responses
|