Wednesday December 18, 2002
I just started using Class::DBI
on a project at $work and it is by far the coolest thing since sliced bread! When you can write a whole data model class in a half dozen lines of code, you better realize you're onto a good thing. It let me beat my own estimate (sometimes notoriously bad even with padding!) for Milestone 1 on this project by 2 days! Many thanks go out to Tony Bowden and all the others who have hacked on Class::DBI.
That said, I'm having a problem where I can't use it like I want. :-) I've gotten a workaround, but it's a total hack. Thus deserving of a good solution. My previous data models could handle having an id of 0 passed to them. It meant, create an empty object. Unfortunately, I can't use
since I get undef in return. How can I work around this? Would calling create() with a minimal hashref and not calling commit() do the trick? ie. not write a database entry? Any ideas welcome. And yes, I posted to the mailing list but have not yet gotten the answer I want. :-)