Posted in April 15, 2009 ¬ 1:43 pmh.admin
I have the join working but it’s not pretty. _tags = DBObject.WhereJoin(“user_id”, “=”, this.ID, typeof(DBTag), “tag_user”, “tag_id”, “id”, DBUser._conn); Right now, in the Where you have to specify all the information about the Join, the table, the columns, etc. and it doesn’t use a property but the column name (because there is no object for [...]
Read the rest of this entry »
Posted in April 6, 2009 ¬ 1:18 pmh.Chris Richards
Ok, so My top pirority for this right now is to get a list of object via a join table. I have the Tag Object, which has ‘id’ and ‘name’. There is a join table tag_user to Join Users to Tags. I need to pull a list of tag via tag_user.
Read the rest of this entry »
Posted in April 3, 2009 ¬ 9:48 amh.Chris Richards
I’ve been avoiding LINQ for several reasons. One is that I’m afraid that it would mean all my code and effort went wasted. (Not a good reason I know.) Another was that it doesn’t really work with MySql yet. I know there are ways to make it work, but it’s not production ready or easy [...]
Read the rest of this entry »
Posted in April 3, 2009 ¬ 3:15 amh.Chris Richards
An idea has struck me. What if the DBObject could build its self from the database? You specify the table and it would take care of all the properties and accessors. The one problem with this would be that you lose type safety and intellisence features. The programmer would have to know what columns exist [...]
Read the rest of this entry »
Posted in March 20, 2009 ¬ 10:45 pmh.Chris Richards
So I made an Index version of the DBObjects to test this new method. To say the least, it’s been a very inlighting. For my test each object had to get 1,248 User records 100 times (so I could get an average). As far as just retraving the inital list, the index method worked considerablly [...]
Read the rest of this entry »
Posted in March 20, 2009 ¬ 11:06 amh.Chris Richards
I’ve been messing around with Objective-C and developing in OSX. So I was reading a tutoral using SQLite3 and the tutoral did something I’d never seen or thought of with the database object. He had the list object populate only the ids (index/primary key) of the objects. Then when you tried to access any of [...]
Read the rest of this entry »
Posted in March 11, 2009 ¬ 12:22 amh.Chris Richards
I’ve been having problems completing this next step. I think I’ve been trying to solve two difficult problems at once. The Dynamic loading of the property, and the joining of the two tables. So I’m taking a step back. Let’s solve the join first. How can I solve this problem with the code I already [...]
Read the rest of this entry »
Posted in March 6, 2009 ¬ 3:52 pmh.Chris Richards
I changed some things around. I added a GetProperty and SetPropery because I didn’t like have to do a check all the time. I think it simplifies things and allows _properties to be private instead of protected. I also created a GetColumns that gives the full name with an optional prefix for select statements. I [...]
Read the rest of this entry »
Posted in March 4, 2009 ¬ 4:10 pmh.Chris Richards
I which I could put this in the base class somehow, but we can simplify the code if the inherited class override the By and Where methods like so /// /// Get a single User By the property and value specified /// /// /// /// static public DBUser By(string property, object value) { return (DBUser)DBObject.By(property, [...]
Read the rest of this entry »
Posted in March 4, 2009 ¬ 3:05 pmh.Chris Richards
Well I guess the next thing to do is to allow an object to relate to another object. For work I use tags for objects (as I discussed earlier) so that’s going to be my starting point. So I have two objects. User and Tag. A single User record can have an unlimited number of [...]
Read the rest of this entry »