The answer to your IT questions
 

Advanced search  • Search tips
My QUESTIONS & ANSWERS
 Question:

JBOSS, CMP beans multi column index in jbosscmp-jdbc.xml ?

User Asked by: xpert
Published on: 09:45/21.11.2007
Status: OPEN
Hi there,
On JBOSS we can define tables for CMP in file jbosscmp-jdbc.xml.

Is there any way to tell jboss to create multi column index when creating tables for CMP entity beans.

Now I have index based on one column. In file jbosscmp-jdbc.xml I have this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 4.0//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_4_0.dtd">
<jbosscmp-jdbc>
<...>
            <cmp-field>
                <field-name>categoryId</field-name>
                <column-name>category_id</column-name>
                <jdbc-type>BIGINT</jdbc-type>
                <sql-type>BIGINT</sql-type>

                <dbindex/>

            </cmp-field>
<...>


I mark the column with <dbindex/> and jboss makes database index on it. But now I want to make database index on two columns.
 Answers: 1
Sort by: /\ date | rating
Image Answer by: james73
Posted on: 09:45/21.11.2007
Rating: 1.6 from possible 5 with 9 votes
I think it is not possible to create multi column index. But you can use composite primary key for the CMP beans(which will make index on 2 or more columns participating in index). You have to create custom indexes manually in your database.
Vote:

Please vote! Your opinion matters!
If you haven't found what you've looking for, post a question
  
| Home | Hall of fame | Register | Log in | Terms of service | Help | Contacts |