Archive for the ‘DBObject’ Category

Join is working

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 [...]

Share
Read the rest of this entry »

Back to bussness

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.

Share
Read the rest of this entry »

LINQ

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 [...]

Share
Read the rest of this entry »

idea

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 [...]

Share
Read the rest of this entry »

On the right path.

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 [...]

Share
Read the rest of this entry »

Speed Questions

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 [...]

Share
Read the rest of this entry »

Difficulties

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 [...]

Share
Read the rest of this entry »

How

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 [...]

Share
Read the rest of this entry »

helpers

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, [...]

Share
Read the rest of this entry »

Next Step

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 [...]

Share
Read the rest of this entry »