It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.
Whether this said that only can use name and/or location field to search the record. So, in my BrokerModel interface have three method: public DiscountRoom getDiscountRoom(String name); public DiscountRoom getDiscountRoom(String locatino); public DiscountRoom getDiscountRoom(String name, String location); public DiscountRoom getAllDiscountRooms(); Is it right? Thanks!
As you said, every value of field is String, but in my db.db file, some field data is another type, such as size is int. Whether when I read it out from the db.db file, should convert it to String, then put it in the String array? If not, how can I do? I have a DiscountRoom class describes a record read from the db.db file. I define some attributes in it to describes every field in the record.
If I do this, how can I create the getDiscountRoom? Whether I put these attributes in a Object array? So, the getDiscountRoom method should Am I right? Thanks.
Joined: Jul 07, 2003
Hi Leo, In this case I would better provide such method in your DBAdapter/Facade interface: // for search DiscountRoom getDiscountRooms(DiscountRoom criteria); // for read DiscountRoom getDiscountRoom(int recNo);
Of course you have to parse all fields while reading them from database to appropriate types. I have done all it almost the same way, except my DiscountRoom class. My DiscountRoom has String and MetaData (class contating Field, describing each elemnt in String. It allows me to avoid type parsing, but I can do it in future by adding getType() method in Field class. It allows me say that my database framework is generic. Advantage of your design is clear business interface between client and server. Advantage of my design database base frawork is a bit more generic and it allows me not parse database fields in the assignement, since it was not required.
Joined: Sep 10, 2002
My DiscountRoom has String and MetaData (class contating Field, describing each elemnt in String.
I think I don't understand your meaning properly. What is MetaData, whether you have two array in the DiscountRoom class? Why do this? Thanks.
Joined: Jul 07, 2003
Hi Leo, Sorry, I didn't want to confuse you with my crazy ideas. If you are interested in my idea about MetaData here is the topic: http://www.coderanch.com/t/183928/java-developer-SCJD/certification/Database-Schema-Facade-Interface MetaData is a class, containing one (and only one!) array of Field objects. Field class contains information about the database field: name, length. Type (Long, Date and so on) can be also added in future. It allows to have a bit more generic framework, rather then declaring the type now. However it looks not so nice like the way you have done. I beleive your solution can be probably not so flexible, but much more understandable and clear (at list for client). So, I didn't critisize your design, just let you know how I have done it. In any case the point was the I managed to do search by declaring only one method: DiscountRoom find (DiscountRoom criteria). Best, Vlad [ August 28, 2003: Message edited by: Vlad Rabkin ]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: [NX:URLyBird] How to serch the date for record?