Thanks.

I checked the sources with a debugger. 

Looks like you can add an "id-method-parameter" element to the table element
in the schema.xml whose value specifies the name of the sequence to use to
generate id's.

The map builder takes the value from here (it's the variable idMethodInfo or
sth like that).

> -----Original Message-----
> From: Wessels, H [mailto:[EMAIL PROTECTED]
> Sent: mardi, 11. mars 2003 14:18
> To: [EMAIL PROTECTED]
> Subject: AW: oracle : bad sequence name
> 
> 
> Hi,
> normally the map builder classes generated by torque provides the name
> for the source of new ids for inserts. The map builder classes should
> correspond to the peer classes. Maybe you can check the sources for
> this.
> 
> Yours,
> Holger Wessels
> -- 
> Holger We�els
> T-Systems
> Systems Integration
> T-Systems Nova GmbH
> Berkom
> Experte F&E
> Hausadresse: Goslarer Ufer 35, 10589 Berlin
> Telefon: (030) 34 97 - 22 66
> Telefax: (030) 34 97 - 22 67
> E-Mail: [EMAIL PROTECTED]
> Internet: http://www.t-systems.com
> Intranet: http://berkom.telekom.de
> 
> 
> -----Urspr�ngliche Nachricht-----
> Von: Pierre Henry [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 11. M�rz 2003 12:00
> An: Jetspeed User List (E-mail)
> Betreff: oracle : bad sequence name
> 
> 
> hi,
> I have the following problem :
> I use views instead of tables for the turbine security tables. These
> views
> are based on tables that are common to several applications, 
> but i don't
> need all the fields of these tables so I made views with only 
> the fields
> corresponding to the original turbine fields. ( eg: the table 
> WEB_USERS
> and
> the view V_TUR_USERS, V_TUR_USERS has exactly the same fields than the
> original TURBINE_USER table )
> 
> It works fine to do selects, but:
> when I want to insert a new user, torque is looking for a 
> sequence whith
> the
> same name as my view.
>  
> Obviously, there can't be any sequence with the same name as a view. 
> 
> I want to use a sequence which is valid for the basic table, not only
> the
> view. Another possibility would be not to use any sequence in the java
> code,
> but to do it via an Oracle trigger on the inserts into the table.
> 
> So my question is : is there a way I can specify the name of the
> sequence to
> use with the "native" id method, or to completely block any sequence
> access.
> I tried to use "none" instead of "native" (modify security schema.xml
> and
> regenerate the Peers classes) but it still tries to read from 
> the wrong
> sequence...
> 
> follow an part of my schema.xml and the extract of my log file.
> 
> Any suggestion welcome !
> 
> Pierre
> 
> security-schema.xml :
> 
> <database>
>       <table name="V_TUR_USER" idMethod="none" javaName="TurbineUser">
>               <column name="USER_ID" required="true" primaryKey="true"
> autoIncrement="true" type="INTEGER"/>
>               <column name="LOGIN_NAME" required="true" size="32"
> type="VARCHAR"/>
>               <column name="PASSWORD_VALUE" required="true" size="32"
> type="VARCHAR"/>
>               <column name="FIRST_NAME" required="true" size="99"
> type="VARCHAR"/>
>               <column name="LAST_NAME" required="true" size="99"
> type="VARCHAR"/>
>               <column name="EMAIL" size="99" type="VARCHAR"/>
>               <column name="CONFIRM_VALUE" size="99" type="VARCHAR"/>
>               <column name="MODIFIED" type="TIMESTAMP"/>
>               <column name="CREATED" type="TIMESTAMP"/>
>               <column name="LAST_LOGIN" type="TIMESTAMP"/>
>               <column name="DISABLED" size="1" type="CHAR"/>
>               <column name="OBJECTDATA" type="BINARY"/>
>               <column name="PASSWORD_CHANGED" type="TIMESTAMP"/>
>               <unique>
>                       <unique-column name="LOGIN_NAME"/>
>               </unique>
>       </table>
>       other tables....
> </database>
> 
> 
> logfile :
> 
> [11 mars 2003 11:57:30 DEBUG] - SELECT V_TUR_USER.USER_ID,
> V_TUR_USER.LOGIN_NAME, V_TUR_USER.PASSWORD_VALUE, 
> V_TUR_USER.FIRST_NAME,
> V_TUR_USER.LAST_NAME, V_TUR_USER.EMAIL, V_TUR_USER.CONFIRM_VALUE,
> V_TUR_USER.MODIFIED, V_TUR_USER.CREATED, V_TUR_USER.LAST_LOGIN,
> V_TUR_USER.DISABLED, V_TUR_USER.OBJECTDATA, 
> V_TUR_USER.PASSWORD_CHANGED
> FROM
> V_TUR_USER WHERE V_TUR_USER.LOGIN_NAME='demo1'
> [11 mars 2003 11:57:30 DEBUG] - Elapsed time=30 ms
> [11 mars 2003 11:57:43 DEBUG] - select V_TUR_USER.nextval from dual
> [11 mars 2003 11:57:43 ERROR] - CreateNewUserAndConfirm
> java.sql.SQLException: ORA-02289: la s�quence n'existe pas (=the
> sequence
> doesn't exist)
>       at
> oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatemen
> t.java:679
> )
>       at com.workingdogs.village.QueryDataSet.<init>(Unknown Source)
>       at
> org.apache.torque.oid.SequenceIdGenerator.getIdAsVillageValue(
> SequenceId
> Gene
> rator.java:195)
>       at
> org.apache.torque.oid.SequenceIdGenerator.getIdAsBigDecimal(Se
> quenceIdGe
> nera
> tor.java:132)
>       at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:702)
>       at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:615)
>       at
> org.apache.jetspeed.om.security.turbine.BaseTurbineUserPeer.do
> Insert(Bas
> eTur
> bineUserPeer.java:242)
>       at
> org.apache.jetspeed.om.security.turbine.BaseTurbineUserPeer.do
> Insert(Bas
> eTur
> bineUserPeer.java:215)
>       at
> org.apache.jetspeed.services.security.turbine.TurbineUserManag
> ement.addU
> ser(
> TurbineUserManagement.java:309)
>       at
> org.apache.jetspeed.services.JetspeedUserManagement.addUser(Je
> tspeedUser
> Mana
> gement.java:134)
>       at
> org.apache.jetspeed.services.JetspeedSecurity.addUser(Jetspeed
> Security.j
> ava:
> 238)
>       at
> org.apache.jetspeed.modules.actions.CreateNewUserAndConfirm.do
> Perform(Cr
> eate
> NewUserAndConfirm.java:206)
>       at org.apache.turbine.modules.Action.perform(Action.java:87)
> etc, etc....
> 

Reply via email to