Troubleshooting

   

Entity Bean Names

I'm confused about how to refer to an entity bean within a query.

EJB QL does not care about the name of your bean implementation classes or the home and component interfaces. When you're defining a finder or select method for an entity, you refer to that bean using its abstract-schema-name as specified in the deployment descriptor.

Empty Strings and null

My conditional expression that checks for a null string is returning true for empty strings.

EJB QL considers an empty string to be non-null. However, you're at the mercy of how your data store interprets empty strings when your queries are executed. Remember that your EJB QL queries are converted in the target language of the data store when your beans are deployed. If the data store treats empty strings as nulls, so will your queries that were specified using EJB QL.

Dates

I don't know how to use a date in an EJB QL query.

EJB QL only knows how to work with dates using a long value expressed in milliseconds since January 1, 1970, 00:00:00 GMT. Use the facilities of java.util.Calendar to generate the millisecond equivalent of any dates you need to use as literals in your queries .



Special Edition Using Enterprise JavaBeans 2.0
Special Edition Using Enterprise JavaBeans 2.0
ISBN: 0789725673
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net