in Advanced 

Question preview

HomeQuestion preview:
Log in

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

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.
Do you know someone who could answer? Ask him for help
Answers: 1
Sort by: date rating
image james73
11:45/21.11.2007
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
Ask question
Related questions:
| Home | Hall of fame | Registration | Log in | Terms of service | Privacy policy | Help | Contacts | RSS |