Hi Dmitry,
You really find a bug in case of the finder method parameter is the reference
'null'.
In your case, the generated source must be
if (p1 == null) {
pStmt.setNull(1, Types.BIGINT);
} else {
pStmt.setObject(1, p1);
}
instead only of
pStmt.setObject(1, p1);
(This kind of code was already generated for the create() and store() methods.)
I already fix this bug in the JOnAS current version.
This fix will be available in the next JOnAS release which will be available
soon.
Thank you very much for this bug report.
I take the liberty of making a remark about the WHERE clause of your finder
methods.
I think that the tests 'is null' are not necessary since the columns are defined
'not null' at the creation table.
Kind regards.
H�l�ne.
Dmitry Guralnik wrote:
>
> Hi,
>
> Here is the container-managed-persistence fields declaration of the bean:
> public long id;
> public long employeeId;
> public long innerresourceId;
> public Timestamp reservationTime;
> public Timestamp startTime;
> public Timestamp finishTime;
> public long reservationUsed;
> public String description;
>
> The script to create the table:
> create table RESERVATION (
> ID NUMBER(8) not null,
> EMPID NUMBER(8) not null,
> RESCID NUMBER(8) not null,
> RESTIME DATE not null,
> STARTTIME DATE not null,
> FINISHTIME DATE not null,
> RESUSED NUMBER(1) not null,
> RESDESCRIPTION VARCHAR2(400),
> constraint PK_RESERVATION primary key (ID),
> constraint FK_RESERVAT_REF1037_EMPLOYEE foreign key (EMPID)
> references EMPLOYEE (ID),
> constraint FK_RESERVAT_REF1038_INNERRES foreign key (RESCID)
> references INNERRESOURCE (ID)
> )
>
> Deployment descriptor lines described my bean:
> <entity>
> <description>Reservation</description>
> <ejb-name>Reservation</ejb-name>
>
> <home>com.debis.intradeb2.webresources.ejb.reservation.ReservationHome</home
> >
>
> <remote>com.debis.intradeb2.webresources.ejb.reservation.Reservation</remote
> >
>
> <ejb-class>com.debis.intradeb2.webresources.ejb.reservation.ReservationBean<
> /ejb-class>
> <persistence-type>Container</persistence-type>
>
> <prim-key-class>com.debis.intradeb2.webresources.ejb.reservation.Reservation
> BeanPK</prim-key-class>
> <reentrant>False</reentrant>
>
> <cmp-field>
> <field-name>id</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>employeeId</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>innerresourceId</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>reservationTime</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>startTime</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>finishTime</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>reservationUsed</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>description</field-name>
> </cmp-field>
>
> </entity>
>
> Jonas-ejb lines described my bean:
> <jonas-entity>
> <ejb-name>Reservation</ejb-name>
> <jndi-name>ReservationHome</jndi-name>
> <is-modified-method-name>isModified</is-modified-method-name>
>
> <jdbc-mapping>
> <jndi-name>intra</jndi-name>
> <jdbc-table-name>Reservation</jdbc-table-name>
>
> <cmp-field-jdbc-mapping>
> <field-name>id</field-name>
> <jdbc-field-name>id</jdbc-field-name>
> </cmp-field-jdbc-mapping>
> <cmp-field-jdbc-mapping>
> <field-name>employeeId</field-name>
> <jdbc-field-name>empid</jdbc-field-name>
> </cmp-field-jdbc-mapping>
> <cmp-field-jdbc-mapping>
> <field-name>innerresourceId</field-name>
> <jdbc-field-name>rescid</jdbc-field-name>
> </cmp-field-jdbc-mapping>
> <cmp-field-jdbc-mapping>
> <field-name>reservationTime</field-name>
> <jdbc-field-name>restime</jdbc-field-name>
> </cmp-field-jdbc-mapping>
> <cmp-field-jdbc-mapping>
> <field-name>startTime</field-name>
> <jdbc-field-name>starttime</jdbc-field-name>
> </cmp-field-jdbc-mapping>
> <cmp-field-jdbc-mapping>
> <field-name>finishTime</field-name>
> <jdbc-field-name>finishtime</jdbc-field-name>
> </cmp-field-jdbc-mapping>
> <cmp-field-jdbc-mapping>
> <field-name>reservationUsed</field-name>
> <jdbc-field-name>resused</jdbc-field-name>
> </cmp-field-jdbc-mapping>
> <cmp-field-jdbc-mapping>
> <field-name>description</field-name>
> <jdbc-field-name>resdescription</jdbc-field-name>
> </cmp-field-jdbc-mapping>
>
> <finder-method-jdbc-mapping>
> <jonas-method>
> <method-name>findById</method-name>
> </jonas-method>
> <jdbc-where-clause>where id = ?</jdbc-where-clause>
> </finder-method-jdbc-mapping>
> <finder-method-jdbc-mapping>
> <jonas-method>
> <method-name>findByEmployeeId</method-name>
> </jonas-method>
> <jdbc-where-clause>where empid = ? order by
> starttime</jdbc-where-clause>
> </finder-method-jdbc-mapping>
> <finder-method-jdbc-mapping>
> <jonas-method>
> <method-name>findByEmployeeIdStartTime</method-name>
> </jonas-method>
> <jdbc-where-clause>where empid = ? and starttime >= ? order by
> starttime</jdbc-where-clause>
> </finder-method-jdbc-mapping>
> <finder-method-jdbc-mapping>
> <jonas-method>
> <method-name>findByInnerresourceId</method-name>
> </jonas-method>
> <jdbc-where-clause>where rescid = ? order by
> starttime</jdbc-where-clause>
> </finder-method-jdbc-mapping>
> <finder-method-jdbc-mapping>
> <jonas-method>
> <method-name>findByFilter</method-name>
> </jonas-method>
> <jdbc-where-clause>where (rescid = ?1 or ?1 is null) and (empid =
> ?2 or ?2 is null) and (starttime >= ?3 or ?3 is null) and (starttime <=
> ?4 or ?4 is null) order by starttime</jdbc-where-clause>
> </finder-method-jdbc-mapping>
> <finder-method-jdbc-mapping>
> <jonas-method>
> <method-name>findAll</method-name>
> </jonas-method>
> <jdbc-where-clause>order by starttime</jdbc-where-clause>
> </finder-method-jdbc-mapping>
>
> </jdbc-mapping>
> </jonas-entity>
>
> I'm waiting your reply....
> Thank you.
>
> Sincerely,
> Dmitry Guralnik
>
> EMail: [EMAIL PROTECTED]
--
-=- H�l�ne JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
mailto:[EMAIL PROTECTED] http://www.evidian.com
Phone: 33.4.76.29.73.53 Fax: 33.4.76.29.76.00
Download our EJB Server JOnAS at http://www.objectweb.org
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".