cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 1.4.0 Preview - ORA-00904

jmi
Champ in-the-making
Champ in-the-making
The next generated sql is worst

create table alf_audit_date (id number(19,0) not null, date date not null, day_of_year number(10,0) not null, day_of_month number(10,0) not null, day_of_week number(10,0) not null, week_of_year number(10,0) not null, week_of_month number(10,0) not null, month number(10,0) not null, quarter number(10,0) not null, halfYear number(10,0) not null, year number(10,0) not null, primary key (id))

Oracle doesn't like: date date not null

So please, use another key halfdate if you want.
2 REPLIES 2

jmi
Champ in-the-making
Champ in-the-making
Well, to correct the problem, unzip the repository.jar and edit org/alfresco/repo/audit/hibernate/Audit.hbm.xml file.

Modify date

<property name="date" column="date" type="date"                index="adt_date_idx" not-null="true"/>

by

<property name="date" column="halfDate" type="date"                index="adt_date_idx" not-null="true"/>

Now it works

    <!– The audit date dimension –>
   
    <class name="org.alfresco.repo.audit.hibernate.AuditDateImpl" proxy="org.alfresco.repo.audit.hibernate.AuditDate" table="alf_audit_date" dynamic-update="false" dynamic-insert="false"
        select-before-update="false" lazy="true" optimistic-lock="version">
       
        <!– An auto-generated id –>
        <id name="id" column="id" type="long">
            <generator class="native"/>
        </id>
       
        <!– Date is used as the key for look up –>
      
        <property name="date" column="halfDate" type="date"                index="adt_date_idx" not-null="true"/>
        <property name="dayOfYear" column="day_of_year" type="integer"     index="adt_doy_idx"  not-null="true"/>
        <property name="dayOfMonth" column="day_of_month" type="integer"   index="adt_dom_idx"  not-null="true"/>
        <property name="dayOfWeek" column="day_of_week" type="integer"     index="adt_dow_idx"  not-null="true"/>
        <property name="weekOfYear" column="week_of_year" type="integer"   index="adt_woy_idx"  not-null="true"/>
        <property name="weekOfMonth" column="week_of_month" type="integer" index="adt_wom_idx"  not-null="true"/>
        <property name="month" column="month" type="integer"               index="adt_m_idx"    not-null="true"/>
        <property name="quarter" column="quarter" type="integer"           index="adt_q_idx"    not-null="true"/>
        <property name="halfYear" column="halfYear" type="integer"         index="adt_hy_idx"   not-null="true"/>
        <property name="year" column="year" type="integer"                 index="adt_y_idx"    not-null="true"/>       
       
    </class>

andy
Champ on-the-rise
Champ on-the-rise
Hi

Thanks for reporting this.

Raised as http://issues.alfresco.com/browse/AR-886.

Regards

Andy