Web domain - 250 APPENDIX A n MORE ADVANCED FEATURES APPENDIX

250 APPENDIX A n MORE ADVANCED FEATURES APPENDIX A n MORE ADVANCED FEATURES In addition to the three SQL terms for writing to the database, you can specify hand-rolled SQL for reading. This is appended as tags outside the class tag (see Listing A-18). They are not intrinsically a part of the mapping. However, you can specify that one of them should be used as the default loader for your class. Listing A-18. An Alternative Mapping File Defining a Default Loader …
SELECT id as {c.id}, ‘NOT SPECIFIED’ as {c.name}, number as {c.number}, streetname as {c.streetname}, town as {c.town}, city as {c.city} FROM Client WHERE id = ?
nTip Unfortunately, this technique is not quite as sophisticated as you might hope the custom SQL will not be invoked in general terms. Only if the id is explicitly supplied, as is the case when calling the Session class s get() method, will the default handling be overridden in favor of the loader query.
You want to have a cheap webhost for your apache application, then check apache web hosting services.

Leave a Reply