-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: How create index oracle
PostPosted: Fri Aug 12, 2005 8:50 am 
Beginner
Beginner

Joined: Thu Aug 11, 2005 11:16 am
Posts: 20
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

hi ,

How create index oracle with hibernate in mapping file ?

(An index is a performance-tuning method of allowing faster retrieval of records. An index creates an entry for each value that appears in the indexed columns. )

The syntax for creating a index with oracle sql is:
CREATE [UNIQUE] INDEX index_name
ON table_name (column1, column2, . column_n)

how do that with hibernate ?

thanks u ,


Hibernate version: 3.0

Mapping documents: 3.0

Name and version of the database you are using: oracle 8.1

_________________
Cyril,


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 8:58 am 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
That's an operation you'd usually perform when first creating the db. Why not just run the SQL to create the indexes from SQL Plus, which is included with Oracle.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 9:15 am 
Beginner
Beginner

Joined: Thu Aug 11, 2005 11:16 am
Posts: 20
i hope an other solution, it's not correct for me to do something by hibernate and something else by sql , it's all by hibernate or nothing !! :0 but if i haven't other solution i do that, thks.

_________________
Cyril,


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 9:28 am 
Expert
Expert

Joined: Thu Dec 04, 2003 12:36 pm
Posts: 275
Location: Bielefeld, Germany
See 21.1.1. Customizing the schema:
http://www.hibernate.org/hib_docs/v3/re ... guide-s1-2

"Some tags accept an index attribute for specifying the name of an index for that column. [...]"

Example:
Code:
<property name="bar" type="my.customtypes.MultiColumnType"/>
    <column name="fee" not-null="true" index="bar_idx"/>
    <column name="fi" not-null="true" index="bar_idx"/>
    <column name="fo" not-null="true" index="bar_idx"/>
</property>


Note that it doesn't need to be a multi-column index.

Best regards
Sven


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 10:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
cyr2005 wrote:
it's not correct for me to do something by hibernate and something else by sql , it's all by hibernate or nothing !!


This is a very, very bad philosophy. Use the right tool for the job.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 10:23 am 
Beginner
Beginner

Joined: Thu Aug 11, 2005 11:16 am
Posts: 20
Ah ... i don't know... i think its strange to use an techno for do something and want you have any problem you do that with another techno... but i remember what u say , you have more experience of me i'am so young !! :)

_________________
Cyril,


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 10:25 am 
Beginner
Beginner

Joined: Thu Aug 11, 2005 11:16 am
Posts: 20
ah and thanks you sven i go to read this article.

_________________
Cyril,


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.