index « Key « JPA Q&A





1. Specifying an index (non unique key) using JPA    stackoverflow.com

How do you define a field, ie email as having an index using JPA annotations. We need a non-unique key on email because there are literally millions of queries on this ...

2. Hibernate problem - creating duplicate foreign key index    coderanch.com

This is my first hibernate app and I have the database schema built and up on mySQL. When I try to insert into the database, hibernate for some reason wants to create the foreign key index. this results in a duplicate foreign key index. Can someone tell me how I configure hibernate to use the foreign key index that already exists ...

5. Create named Primary Key indexes    forum.hibernate.org

6. Prevent Hibernate from creating Indexes for Foreign Keys    forum.hibernate.org

@Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @Table(name = "vehicle") @DiscriminatorColumn(...) abstract class Superclass { T entity; @ManyToOne(cascade = ...) @JoinColumn(nullable = true) public T getEntity() { return entity; } ... }

7. Hibernate 3.2.3, foreign-key and index names    forum.hibernate.org

Hi, all! I'm using hbm2dll to generate the DDL file from *.hbm.xml files. Due to requirements of my current project the names of database constraints (primary, foreign, unique key) and indexes must follow some strict naming rules. The foreign key and index names can be set in the hbm.xml files. Unfortunately I cannot use this approach for technical reasons (long story). ...

8. unique index on a FK    forum.hibernate.org

Hibernate version: 2.1.6 Mapping documents: Parent table protected Child table protected ...

9. Index and unique-key    forum.hibernate.org

How do I add an index onto a regular property? I've looked through most of the documentation, found nothing at first, went through the dtd, found what the attribute should be, and checked the docs again, found minor mention in chapter 15 (toolset). (Yes, I have tried values apart from 'true', ...





10. Name index on PK    forum.hibernate.org

I guess you are trying to use auto schema generation. I would not recommend doing so, it is better to generate DB Schema from DDL. Schema check at startup significantly increases the startup time, which is inconvenient for development and does not produce optimal DB schema because Hibernate mapping does not seem to have a way to define PK index name ...

11. Preventing the creation of an index on a foreign key    forum.hibernate.org

I am using SchemaExport to automatically create our database, which has a fairly simple structure (about 10 entities in total). The schema thus created is perfect for our purposes, with one little nagging detail. I have a many-to-one association from entity SDR to entity C. This forces the creation of an index on a foreign key in SDR. This index is ...

12. Help on having a primary key being used as a linst-index    forum.hibernate.org

Hello, Im not managing to have a primary key being used as a linst-index. I have 2 POJOS A,B. A objects have a List of B objects hibernate ...

13. Multiple index with one primary key    forum.hibernate.org

14. Index on foreign keys    forum.hibernate.org

Hi, I am using hibernate 3 annotations I want to add indexes on foreign keys I have something like @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinColumn(name = "ANATOMY_ID") @ForeignKey(name = "FK_W_DEVICE_ANATOMY") @Index (name = "FK_W_DEVICE_ANATOMY") --------//THROWS ERROR public Anatomy getAnatomy() { return anatomy; } I also have @OneToMany(cascade = CascadeType.ALL) @Fetch(FetchMode.SUBSELECT) @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @JoinColumn(name = "WIRELESS_DEVICE_ID") @ForeignKey(name = "FK_CAMERA_W_DEV") @Index ...

15. Hibernate. specify a index key length    forum.hibernate.org

Hello, I have this property in my hibernate .hbm.xml file, and it works ok: However, this one fails (when using Mysql): with: 16:03:00,013 ERROR SchemaExport:274 - Unsuccessful: create index sourceId on Item (sourceId) 16:03:00,013 ERROR SchemaExport:275 - BLOB/TEXT column 'sourceId' used in key specification without a key length That is, with MySql you ...

16. Remove index on primary key? possible in Hibernate?    forum.hibernate.org

Is it possible to configure an entity so that Hibernate will NOT put an index on the primary key? I have a large table and need to have an index on another column and have no need for an index on the primary key so I would like to remove it for performance reasons.[/code]





17. Indexing keys question    forum.hibernate.org

Beginner Joined: Thu May 28, 2009 10:25 am Posts: 21 What's the correct annotation to index by the fields below? Please point out what I'm doing wrong. I'd prefer to use JPA annotations instead of the hibernate @Index annotation I'm playing with. Also, why do all the last 3 entries of my "show keys" output refer to "GROUPID Thanks Code: mysql> ...