Hi Atul,

At first, I thought there was a problem with "USER_ID" being the primary
key.
But it appears to be a ID field, which is misleading, since it had me
thinking that it was the foreign key between the TURBINE_USER table and this
table. I'd recommend a dependent relationship between TURBINE_USER and
JETSPEED_USER_PROFILE (cascading deletes), which means adding another column
for the foreign key - at that point you will have a column name conflict (i
don't like naming common columns differently across tables), so maybe all of
your primary keys could be called PSML_ID, which is also less confusing.
Likewise for TURBINE_GROUP AND JETSPEED_GROUP_PROFILE, and TURBINE_ROLE and
JETSPEED_ROLE_PROFILE.
Questions I have are:
- does Torque support cascading deletes?
- all databases don't support cascading deletes. Will Torque compensate?


There should be some search keys defined. Taking the JETSPEED_USER_PROFILE,
here are some common use cases  :

- lookup the PSML page for the current user + the current request
parameters:
LOGIN_NAME + MEDIA_TYPE + LANGUAGE + COUNTRY

- lookup the PSML page by name for the current user + current request
parameters:
LOGIN_NAME + MEDIA_TYPE + LANGUAGE + COUNTRY + PAGE

One index would handle both above:
LOGIN_NAME + MEDIA_TYPE + LANGUAGE + COUNTRY + PAGE

Another case I can think of is find all PSML for the given user, sometimes
restricted by media type.
Again, the above index covers that.

I believe country codes and language codes are always 2 characters wide, but
definately not these two:

>      <column name="MEDIA_TYPE" size="99" type="VARCHAR"/>
>      <column name="PAGE" size="99" type="VARCHAR"/>

Im not very familiar with Torque anymore, but the "99" looks very numeric
too me, esp. for fields like media_type and page, which would normally
contain strings. If you are restricting the COUNTRY and LANGUAGE to numeric,
then thats a problem too. Guess I need to re-readup on Torque,

David



> -----Original Message-----
> From: Atul Dambalkar [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 04, 2001 2:15 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: XML Database schema for DatabasePsmlManager Implementation
>
>
> Hi Jon, David,
>
> Here is the XML Database schema for putting PSML information
> along with
> user/role/group profile. Please review it.
> =======================================================
> <app-data>
>
> <database defaultIdMethod="idbroker"
>            basePeer="org.apache.turbine.om.peer.BasePeer" >
>
>    <table name="JETSPEED_USER_PROFILE" idMethod="idbroker">
>
>      <column name="USER_ID" required="true" autoIncrement="true"
>              primaryKey="true" type="INTEGER"/>
>      <column name="LOGIN_NAME" required="true" size="32"
> type="VARCHAR"/>
>      <column name="MEDIA_TYPE" size="99" type="VARCHAR"/>
>      <column name="LANGUAGE" size="99" type="VARCHAR"/>
>      <column name="COUNTRY" size="99" type="VARCHAR"/>
>      <column name="PAGE" size="99" type="VARCHAR"/>
>      <column name="PROFILE" type="VARBINARY"/>
>
>      <unique>
>         <unique-column name="LOGIN_NAME" />
>      </unique>
>
>    </table>
>
>    <table name="JETSPEED_GROUP_PROFILE" idMethod="idbroker">
>
>      <column name="GROUP_ID" required="true" autoIncrement="true"
>              primaryKey="true" type="INTEGER"/>
>      <column name="GROUP_NAME" required="true" size="99"
> type="VARCHAR"/>
>      <column name="MEDIA_TYPE" size="99" type="VARCHAR"/>
>      <column name="LANGUAGE" size="99" type="VARCHAR"/>
>      <column name="COUNTRY" size="99" type="VARCHAR"/>
>      <column name="PAGE" size="99" type="VARCHAR"/>
>      <column name="PROFILE" type="VARBINARY"/>
>      <unique>
>         <unique-column name="GROUP_NAME" />
>      </unique>
>
>    </table>
>
>    <table name="JETSPEED_ROLE_PROFILE" idMethod="idbroker">
>
>      <column name="ROLE_ID" required="true" autoIncrement="true"
>              primaryKey="true" type="INTEGER"/>
>      <column name="ROLE_NAME" required="true" size="99"
> type="VARCHAR"/>
>      <column name="MEDIA_TYPE" size="99" type="VARCHAR"/>
>      <column name="LANGUAGE" size="99" type="VARCHAR"/>
>      <column name="COUNTRY" size="99" type="VARCHAR"/>
>      <column name="PAGE" size="99" type="VARCHAR"/>
>      <column name="PROFILE" type="VARBINARY"/>
>
>      <unique>
>         <unique-column name="ROLE_NAME" />
>      </unique>
>
>    </table>
>
> </database>
> ===============================================================
>
> I could generate all the peer classes, but "torque" fails if
> I try to use
> "native" as idMethod. So I have to use "idbroker".
>
> Questions:
> 1. The generated package name, I decided as:
> "org.apache.jetspeed.om.dbpsml" Is that okay?
> 2. The basePeer for generated peer classes is
> org.apache.turbine.om.peer.BasePeer. Hope that's correct...
>
> Also, how could we automate the process of generating
> database specific
> peer classes, when some one decides to use it for let's say
> MSSQL? Right
> now I am trying it with Oracle.. Currently I have generated
> all the peer
> classes with stand-alone version of Torque and manually
> copied them under
> Jetspeed cources, and got all compiled.
>
> Christopher, now, you don't have to define a separate schema
> in MSSQL, the
> above Torque schema will handle all the different database cases.
>
> -Atul
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to