Git Product home page Git Product logo

sqlitepersistentobjects's People

Watchers

 avatar

sqlitepersistentobjects's Issues

2 Typos in NSDate-SQLitePersistence.m

What steps will reproduce the problem?
1. Just compile the files.

There are two missing "];" in NSDate-SQLitePersistence.m on lines 27 and 34.  
This:

[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSSS"

Should be:

[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSSS"];


Original issue reported on code.google.com by [email protected] on 7 Sep 2008 at 4:37

Leak in SQLitePersistentObject.m resolveClassMethod

What steps will reproduce the problem?
1. Load an object

What is the expected output? What do you see instead?
It loads without leaks. There is a leak.

What version of the product are you using? On what operating system?
r129, Mac OS X 10.5.6, iPhone SDK 2.2.1

Please provide any additional information below.

The string methodbeingcalled never get's released.
You have to add this at the end of the method:

                //Why not release the string?
        [methodBeingCalled release];

        return [super resolveClassMethod:theMethod];

Regards,
Fabian

Original issue reported on code.google.com by [email protected] on 6 Mar 2009 at 8:38

Seem to get an infinite loop error when loading objects using code in rev 34.

What steps will reproduce the problem?
1. NSArray * lastUsedArr = [UserPreference findByPrefKey:@"lastUsedX"];
2. The UserPreference object is a simple name/value pairing 


What is the expected output? What do you see instead?

Should load the object if available or get nil.  Instead, I get this exception:

BAD_ACCESS exception.

#0 0x95e158cf in CFAllocatorAllocate
#1 0x95e9560d in __CFStrAllocateMutableContents
#2 0x95e98c25 in __CFStringChangeSizeMultiple
#3 0x95ea2027 in CFStringAppend
#4 0x95ea2d63 in _CFStringAppendFormatAndArgumentsAux
#5 0x95ea44c8 in _CFStringCreateWithFormatAndArgumentsAux
#6 0x940d92e6 in -[NSPlaceholderString initWithFormat:locale:arguments:]
#7 0x940d9278 in +[NSString stringWithFormat:]
#8 0x00004ceb in -[NSString(UppercaseFirst) stringByLowercasingFirstLetter]
at NSString-UppercaseFirst.m:35
#9 0x0000ae99 in +[SQLitePersistentObject resolveClassMethod:] at
SQLitePersistentObject.m:845
#10 0x947c001e in _class_resolveMethod
#11 0x0000af3c in +[SQLitePersistentObject resolveClassMethod:] at
SQLitePersistentObject.m:856
#12 0x947c001e in _class_resolveMethod
#13 0x0000af3c in +[SQLitePersistentObject resolveClassMethod:] at
SQLitePersistentObject.m:856
#14 0x947c001e in _class_resolveMethod

snip

#58172 0x947c001e in _class_resolveMethod
#58173 0x0000af3c in +[SQLitePersistentObject resolveClassMethod:] at
SQLitePersistentObject.m:856
#58174 0x947c001e in _class_resolveMethod
#58175 0x947c02d5 in _class_lookupMethodAndLoadCache
#58176 0x947d06d6 in objc_msgSend
#58177 0x00004138 in -[FirstViewController viewDidLoad] at
FirstViewController.m:322
#58178 0x30c1e66e in -[UINib
instantiateWithOptions:owner:loadingResourcesFromBundle:]
#58179 0x30c204b8 in -[NSBundle(NSBundleAdditions) loadNibNamed:owner:options:]

What version of the product are you using? On what operating system?

rev 34, iphone SDK, under simular.

Please provide any additional information below.

I have reverted to the earlier revision of sqlitePOs for now - that works fine.

Original issue reported on code.google.com by kimptoc on 19 Dec 2008 at 1:16

Support for transient properties

I have properties that should not be persisted, so I have added a facility
to ignore properties in a similar manner to the indices facility - you add
a method called transients to define properties that should not be persisted.

Original issue reported on code.google.com by kimptoc on 9 Jan 2009 at 10:57

Attachments:

Once a table for an object has been created, adding new properties to the object will cause save to fail

What steps will reproduce the problem?
1. Create an object with some number of properties and save it
2. Notice the save causes a new table to be created
3. Modify that object so it includes an additional property
4. Save again and notice the save fails

What is the expected output? What do you see instead?
I'd expect the table to automatically update with an appropriately new column.  
If that's not the 
expected behavior what's this projects upgrade philosophy?  Say Version 1.0 
ships with a set 
table structure.  1.1 is released with a column added in some table.  How does 
the data get 
upgraded?

What version of the product are you using? On what operating system?


Please provide any additional information below.



Original issue reported on code.google.com by [email protected] on 7 Jan 2009 at 10:43

[PATCH] Deleting an unsaved object raises an exception

What steps will reproduce the problem?
1. MySQLPOSubclass *obj = [[MySQLPOSubclass alloc] init];
2. [obj deleteObject];

What is the expected output? What do you see instead?
It shouldn't blow up.  It blows up.

What version of the product are you using? On what operating system?
63


Original issue reported on code.google.com by [email protected] on 11 Feb 2009 at 12:36

Attachments:

Typo in NSNumber(SQLitePersistence) ?

I believe there is a typo in trunk's NSNumber-SQLitePersistence.m, for the 
following:

+ (id)ObjectWithSqlColumnRepresentation:(NSString *)columnData;

When it should be:

+ (id)objectWithSqlColumnRepresentation:(NSString *)columnData;

(A lowercase O). 

Original issue reported on code.google.com by [email protected] on 14 Nov 2008 at 12:28

Does not compile + patch of quick fixes to get it working

Greets.

Tried to compile in Xcode for iPh*ne development, got some errors.  Made
some (somewhat dirty) fixes to get it working and am attaching the diff
file here...

Things that need to be fixed fer'real include my quick hacks to get it
working using UIKit

-#if (TARGET_OS_MAC && ! (TARGET_OS_EMBEDDED || TARGET_OS_ASPEN))
+#if (0 && TARGET_OS_MAC && ! (TARGET_OS_EMBEDDED || TARGET_OS_ASPEN))

as I wasn't sure how to detect this reliably. Also, the error message
container from sqlite3_exec was never declared, so I guessed at an
appropriate type... uhm, it probably needs to be freed too in the section:


+               char * errorMsg;
                if (sqlite3_exec(database, "PRAGMA encoding = \"UTF-8\"",
NULL, NULL, &errorMsg) !=
 SQLITE_OK) {


So that's it.  Compiles now, have yet to actually try it out... can't wait.
 Thanks for sharing, this is neat work :)

Regards,
Pat Deegan            



Original issue reported on code.google.com by [email protected] on 21 Oct 2008 at 2:30

Attachments:

Can't Delete Object With Camel Case Class Name [fix included]

What steps will reproduce the problem?
1. Create a persistent object with a CamelCase class name, i.e. DCTestObject
2. Try to delete an instance of that object.

What do you see instead?
Returns error message "Error deleting row in table: no such table: DCTestObject"

These lines need to be changed in SQLitePersistentObject.m:
Line 702: [self className] to [[self class] tableName]
Line 722: [self className] to [[self class] tableName]
Line 730: [self className] to [[self class] tableName]


Original issue reported on code.google.com by [email protected] on 7 Sep 2008 at 7:11

AUTOINCREMENT primary keys

I asked this on the google group[1].  The AUTOINCREMENT approach makes
sense to me, but maybe there are some sqlite gurus who can weigh in.

[1]
http://groups.google.com/group/sqlitepersistentobjects-user/browse_thread/thread
/5110d82e70912446#

Original issue reported on code.google.com by [email protected] on 21 Feb 2009 at 6:44

Problem loading NULL columns into NSString

NSArray *allMyModels = [myModel findByCriteria:@""];

When using code like this above, if any of the properties are NSStrings and are 
stored as NULL in 
the database, there is an error when loading them back in.

I know how to fix this, I just wanted a record of it. :)

Original issue reported on code.google.com by [email protected] on 2 Sep 2008 at 10:19

memory leak after calling class_copyPropertyList?

I'm not even sure about this one and don't have the knowledge to validate
my claim; Obj-C is new to me!

Shouldn't you call free(propList) in SQLitePersistentObject.m
 +(NSDictionary *)propertiesWithEncodedTypes after using
class_copyPropertyList?

The Apple doc says something about calling free() on the array after using
class_copyPropertyList.
(http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/ObjCRuntimeRef/Referen
ce/reference.html#//apple_ref/c/func/class_copyPropertyList)

If I'm wrong, well, I know I still have a lot to learn !
Great code,

-MR.

Original issue reported on code.google.com by [email protected] on 15 Jan 2009 at 7:20

enhancement: SQLitePersistentObject implement NSMutableCopying

When editing a SQLitePersistentObject, it would be helpful to work on a copy of 
the object.  
Changes made to the copy could be committed by saving the copy or discarded if 
the user 
cancels the editing action.  Since SQLitePersistentObject has only one instance 
member, 
implementing NSMutableCopying is easy:

#pragma mark -
#pragma mark NSMutableCopying

- (id)mutableCopyWithZone:(NSZone *)zone {
    SQLitePersistentObject *copy = [[[self class] allocWithZone:zone] init];
    [copy setPk:[self pk]];
    return copy;
}

This doesn't appear to break the internal caching since the copy will replace 
the original in the 
cache when the save message is received.

Original issue reported on code.google.com by [email protected] on 28 Dec 2008 at 11:53

NSObject may not respond to class name warning

What steps will reproduce the problem?

1. Create a new window-based application in Xcode.
2. Add the sqlitepersistentobjects src directory to the project.
3. Add linsqlite3.0.dylib to the project.
4. Build project for iPhone OS 2.1 (Release or Debug)


What is the expected output? What do you see instead?

When built for the device I get the following warnings from the compiler:
../src/NSObject-SQLitePersistence.m (2 warnings)
    warning: 'NSObject' may not respond to '-className'
    warning: 'NSObject' may not respond to '+className'

When built for the simulator there are no warnings.  I think this would be the 
desired behavior.


What version of the product are you using? On what operating system?

I'm using Xcode 3.1.1 with iPhone 2.1 final SDK and rev. 28 of 
sqlitepersistentobjects.



Original issue reported on code.google.com by [email protected] on 12 Nov 2008 at 4:48

Any chance of FAQ page on the wiki?

Perhaps using/linking to the readme as a start.

Things that come to mind are:

- arrays of arrays -> not currently supported

- parent/child persistence, how to save/load, do you load/save parent and
child individually or does loading the parent also load its children (will
look at code to determine this for now).

Original issue reported on code.google.com by kimptoc on 19 Dec 2008 at 7:27

Trying to do parent/child, but not quite getting it, any tips? (newbie problem...)

What steps will reproduce the problem?
1. I have modified the test code to have a child relationship to the Person
object - a collection of Limb objects (see attached diff)
2. It does a crude add of a random number of limbs
3.

What is the expected output? What do you see instead?
I seem to have broken the existing Person maintenance logic, it seems to
replace Person entries when you create more than one.. but I can't see why.

What version of the product are you using? On what operating system?
Rev 35, Mac os x 10.5.6, iphone simulator, 2.2

Please provide any additional information below.
Sorry, I know this is a bug in my code...

Original issue reported on code.google.com by kimptoc on 20 Dec 2008 at 9:59

Attachments:

Incorrect handling of consecutive numbers when doing propName->colName

What steps will reproduce the problem?
1. name a property foo123
2. property->colName will give foo_1_2_3
3. colName foo_123->propName will give foo123

What is the expected output? What do you see instead?

  I have a column named foo_123 and a property foo123.  
  When I save I get an error "...table XX has no column foo_1_2_3"...

  The logic in NSString-SQLiteColumnName could be MUCH more robust
  E.G. no checking for illegal characters.  Assumes all characters, etc

What version of the product are you using? On what operating system?

 latest, on OSX 10.5.6 / Phone OS 2.2.1

Please provide any additional information below.

As a quick hack I changed the code to:

- (NSString *)stringAsSQLColumnName
{
    NSMutableString *ret = [NSMutableString string];
    NSString *oneChar = nil;
    NSString *lastChar = nil;

    for (int i=0; i < [self length]; i++)
    {
        NSRange sRange = NSMakeRange(i,1);
        oneChar = [self substringWithRange:sRange];
        if ([[NSCharacterSet letterCharacterSet] characterIsMember:[oneChar 
characterAtIndex:0]] &&
            [oneChar isEqualToString:[oneChar uppercaseString]] && i > 0) {
            [ret appendFormat:@"_%@", [oneChar lowercaseString]];
        } else if ([[NSCharacterSet decimalDigitCharacterSet] characterIsMember:[oneChar 
characterAtIndex:0]] &&
                   ![[NSCharacterSet decimalDigitCharacterSet] characterIsMember:[lastChar 
characterAtIndex:0]] &&
                   i > 0) {
            [ret appendFormat:@"_%@", oneChar];
        } else {
            [ret appendString:[oneChar lowercaseString]];
        }
        lastChar = oneChar;
    }
    return ret;
}

See useful java code from WO attached.  When I get a chance I'll do a good 
port...


Original issue reported on code.google.com by [email protected] on 21 Feb 2009 at 4:52

Attachments:

Objects should start life as Dirty

What steps will reproduce the problem?
1. Create an object that is a subclass of SQLitePersistentObject
2. Initialize various instance variables in init using the member variables
3. Call save on the object
4. Nothing saved because nothing marked dirty because the observer was
never called.

What is the expected output? What do you see instead?
Expected to see the object saved but instead nothing is saved

What version of the product are you using? On what operating system?
Trunk at rev 62.

Please provide any additional information below.
The dirty instance variable in SQLitePersistentObject should be initialized
to YES in init rather than NO. Any newly instantiated object should be
considered to be dirty.

Original issue reported on code.google.com by [email protected] on 8 Feb 2009 at 4:37

nil collection classes cause off-by-one insertion on - [SQLitePersistentObject save]

What steps will reproduce the problem?
1. Create an SQLitePersistentObject subclass with a collection class ivar, 
another supported ivar type 
and the associated @property declarations.
2. Set the collection class instance to nil
3. Instantiate an instance and save it

What is the expected output? What do you see instead?
It's expected that the object will be properly saved.

The problem occurs in SQLitePersistentObject.m:568-571 - the code that checks 
if the property is 
nil doesn't take into account that the property type might be a collection type.

    id theProperty = [self valueForKey:propName];
    if (theProperty == nil)
    {
        sqlite3_bind_null(stmt, colIndex++);
    }

Since null is bound regardless of whether or not the property was intended to 
be be bound (as 
determined in lines 540:552), an extra null bound and the colIndex is 
incorrectly incremented.

The workaround is to make sure your collection properties aren't null when you 
save, 

Original issue reported on code.google.com by eric.s.blair on 4 Dec 2008 at 8:33

Properties/Columns With First Letter Capitalized Breaks Reading Process [possible fix included]

What steps will reproduce the problem?
1. Create a persistent object with a property/column that has the first letter 
capitalized, i.e. 
"XMLName" and at least one column after it.
2. Write a record to the database.
3. Try to read the records with findByCriteria:@"" and the column after 
"XMLName" won't be read.

This seems to fix the issue:
NSString-SQLiteColumnName.m, Line 32, delete "&& i > 0" from the if statement.  
I think this just 
prepends a _ when the first letter is capitalized.

It seems to be working with this fix, but I'm not sure if there was a reason 
that the "&& i > 0" was 
added in the first place.


Original issue reported on code.google.com by [email protected] on 7 Sep 2008 at 10:58

Inconsistent terminology: properties vs fields

Some methods refer to fields (e.g. -revertField:), while others refer to 
properties (e.g. 
-pairedArraysForProperties:).  But unless I'm misunderstanding, they are both 
dealing with 
properties.  So it should be -revertProperty: instead (and -revertProperties:).

Original issue reported on code.google.com by [email protected] on 6 Mar 2009 at 10:18

deleteObjectCascade doesn't delete children correctly

I have two tables: activity and task. There is a link table between them named 
activity_tasks. In 
my Activity object, I created an NSMutableArray that contains the task records 
and named the 
property tasks. In the deleteObjectCascade:YES, it doesn't remove the records 
from the task 
table correctly (although it tries). It does remove the records from the 
activity_tasks correctly.

I have found many problems with that part of the method, but want to see how 
you would like to 
handle this situation. The problem is that it can't figure out that the 'tasks' 
property actually 
contains records from the 'Task' table. There is no method currently for 
removing the plural and 
converting to a class name. Another approach would be to register the array 
somehow in the 
parent class itself. What would be ideal is a solution that works for 
loading/saving and deleting. 

In ActiveRecord (at least in RoR), you must specify the relationship with a 
child and the array is 
added for you. In our case, I think we are just missing this relationship 
reference.

Either way, if that method is really going to remove the child records, then it 
needs to perform 
the correct delete statement. The one that is there currently doesn't work at 
all.

I'll help fix this, just want some input before I go down a path you don't like.




Original issue reported on code.google.com by [email protected] on 28 Oct 2008 at 12:02

Leak in +[NSMutableData initWithSQLBlobRepresentation:]

@implementation NSMutableData(SQLitePersistence)
- (id)initWithSQLBlobRepresentation:(NSData *)data
{
    self = [[NSMutableData dataWithData:data] retain];
    return self;
}
@end

In this method, the original +[self alloc] call is not balanced by a 
corresponding release. The 
assignment of self causes this.

Fix:

- (id)initWithSQLBlobRepresentation:(NSData *)data
{
    return [self initWithData:data];
}




Original issue reported on code.google.com by j.p.dann on 23 Jan 2009 at 3:11

sortedFieldValuesWithKeysForProperty not working correctly

What steps will reproduce the problem?
1. Use sortedFieldValuesWithKeysForProperty: 
2. Get allKeys from the returned dictionary
3. The ordering of the returned keys is not sorted correctly

What is the expected output? What do you see instead?

The expected output is a list of sorted property values. The list is not sorted 
because of the 
dictionary. I adapted the method on SQLitePersistentObject to return an array 
of orderered 
properties as well as the dictionary. 

Header and implementation of the working change attached...


What version of the product are you using? On what operating system?

SVN head


Please provide any additional information below.

See attached header and implementation for a working fix. We can't rely on 
dictionaries returning 
keys in the ordered they were added. 



Original issue reported on code.google.com by [email protected] on 16 Dec 2008 at 12:44

Attachments:

Error in SQLitePersistentObject's save

 586                         else if ([propType isEqualToString:@"c"] ||     // char
 587                                          [propType isEqualToString:@"C"] ) // unsigned char
 588 
 589                         {
 590                                 NSString *theString = [theProperty stringValue];
 591                                 sqlite3_bind_text(stmt, colIndex, [theString UTF8String], -1, NULL);
 592                         }

colIndex isn't being incremented here like it is elsewhere, which will cause 
columns to get mixed 
up. 

Original issue reported on code.google.com by [email protected] on 14 Nov 2008 at 12:30

Leak in +[NSNumber objectWithSqlColumnRepresentation]

What version of the product are you using? On what operating system?
On iPhone OS and Mac OS without GC-enabled the following leaks:

if (doubleValue == longValue)
        self = [[NSNumber alloc] initWithLongLong:longValue];
    else
        self = [[NSNumber alloc] initWithDouble:doubleValue];

Please provide any additional information below.

these should be autoreleased explicitly or should be -[NSNumber 
numberWithLongLong] and -
[NSNumber numberWithDouble] respectively



Original issue reported on code.google.com by j.p.dann on 23 Jan 2009 at 2:41

Memory leak

Method +(NSDictionary *)propertiesWithEncodedTypes in class 
SQLitePersistentObject has a 
memory leak.

You must free the array returned from the following call:
   objc_property_t *propList = class_copyPropertyList([self class], &outCount);

Adding the following line at the end of the method solves the problem:
      free(propList);

Cool library by the way. Thanks for doing this.

Original issue reported on code.google.com by [email protected] on 23 Oct 2008 at 3:28

Nil field of SQLitePersistentObject subclass causes NSInvalidArgumentException

What steps will reproduce the problem?
1. Create a class WidgetPart that extends SQLitePersistentObject.
2. Create a class Widget that has a property of type WidgetPart.
3. Save a Widget instance with a nil value for the WidgetPart property.
4. [Widget allObjects]

What is the expected output? What do you see instead?

Expected result is an array with a Widget object containing a nil value for the 
WidgetPart 
property.

Actual result is a runtime exception:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '*** 
+[NSString stringWithUTF8String:]: NULL cString'

What version of the product are you using? On what operating system?

URL: http://sqlitepersistentobjects.googlecode.com/svn/trunk
Repository Root: http://sqlitepersistentobjects.googlecode.com/svn
Repository UUID: e86f48c2-4f55-0410-860d-1fbeb81bd84d
Revision: 28

Please provide any additional information below.

Workaround: do a check for null at SQLitePersistentObject.m around line 238:

                        if ([propClass isSubclassOfClass:[SQLitePersistentObject class]])
                        {
                            const char *keyCStr = (const char 
*)sqlite3_column_text(statement, i);
                            if (keyCStr) {
                                NSString *objMemoryMapKey = [NSString 
stringWithUTF8String:keyCStr];
                                                                // and so on
                            }
                            else {
                                [oneItem setValue:nil forKey:propName];
                            }
                        }


Original issue reported on code.google.com by [email protected] on 13 Jan 2009 at 5:34

new KVO changes prevent Collections with objects other than SQLitePersistent objects from saving.

What steps will reproduce the problem?
1. Run Test SaveAndLoadData with Collections Fixture

2 this attempts to save a SQLite object with NSArray property containing
NSString objects

3. the object cannot detect that is it has become dirty and never saves.

4. The method observeValueForKeyPath does not get invoked when updating
data on a collection property of the object.




Original issue reported on code.google.com by [email protected] on 5 Feb 2009 at 10:20

Create a discussion group for this project

While I'm sure the creators are busy enough that they don't want to do a lot of 
support, simply 
having a discussion group so other users can help each other out would be 
useful.  

Original issue reported on code.google.com by [email protected] on 1 Feb 2009 at 9:33

Nested arrays aren't being saved..

What steps will reproduce the problem?
1. create an array holding other arrays or a dictionary
2. save the object


What is the expected output? What do you see instead?

- The object should save the Array and all it's sub arrays. Instead the sub 
arrays have a NULL value.


Original issue reported on code.google.com by [email protected] on 16 Sep 2008 at 1:20

r9 does not not compile.

I found 2 issues trying to compile trunk.
1. Several headers use following construct
#if (TARGET_OS_MAC && ! (TARGET_OS_EMBEDDED || TARGET_OS_ASPEN))    
#import <Cocoa/Cocoa.h>
#else
#import <UIKit/UIKit.h>
#endif

On my system this includes "Cocoa.h" even building iPhone project. As a quick 
fix I changed 
#if (TARGET_OS_MAC && ! (TARGET_OS_EMBEDDED || TARGET_OS_ASPEN))    
to
#if (TARGET_OS_MAC && ! (TARGET_OS_EMBEDDED || TARGET_OS_ASPEN || 
TARGET_OS_IPHONE))  

2. SQLiteInstanceManager.m:88: if (sqlite3_exec(database, "PRAGMA encoding = 
\"UTF-8\"", 
NULL, NULL, &errorMsg) != SQLITE_OK) {

But errorMsg is not defined anywhere.

Thanks

Original issue reported on code.google.com by [email protected] on 11 Oct 2008 at 7:27

Support for Many-to-Many relations

Currently there's no way to create many-to-many relations. Attempt to use the 
following model:

@interface A {
    NSArray *items; // items of class B
}

@interface B {
    NSArray *items; // items of class A
}

results in recursion and crash.

Original issue reported on code.google.com by farcaller on 18 Dec 2008 at 6:17

SQLITE_RANGE Error in SQLitePersistentObject's save

The code in save can end up binding to more columns than exist due to this 
check:

            if (theProperty == nil)
            {
                sqlError = sqlite3_bind_null(stmt, colIndex++);


The property may be nil, however the object may be on that facilitates a cross 
reference -- and 
thus won't ever use a column (as one wasn't created for it in checkTable).


Original issue reported on code.google.com by [email protected] on 16 Nov 2008 at 4:32

UIColor persistence fails due to private subclasses

What steps will reproduce the problem?
1. Create a persistent object with a UIColor property.
2. Set the property to [UIColor redColor].
3. Call save.
4. Reload from persistence.

What is the expected output? What do you see instead?

Expected: reloaded object has a UIColor property with a red color.
Actual: UIColor property in reloaded object is nil.

This is occurring because [UIColor redColor] returns an object of type 
UICachedDeviceRGBColor, 
not UIColor, and the keyed archiver uses the class name as a key.

What version of the product are you using? On what operating system?

iPhone OS 2.2

Please provide any additional information below.

Workaround is a custom persister for UIImage that uses a static key for the 
archiver.  I'm filing 
the bug because this is likely to be a common problem.

Original issue reported on code.google.com by [email protected] on 29 Dec 2008 at 1:28

Attachments:

Please expose methods needed for custom complex queries

In my subclass of SQLitePersistentObject to add my 
+dictionariesForProperties:withCriteria:sortedBy: method, I needed the 
following private methods.  
Please expose them in the headers:

+ (void)tableCheck;
- (void)makeClean;
- (void)markDirty;
- (BOOL)isDirty;

The +tableCheck method could be omitted if you instead provide other methods to 
perform a 
query and step through the results.

Original issue reported on code.google.com by [email protected] on 6 Mar 2009 at 10:23

+ [SQLitePersistentObject tableCheck] double-converting column names

What steps will reproduce the problem?
1. Create a SQLitePersistentObject subclass that contains an collection class 
ivar and @property 
declaration. The property name must contain in interCap.
2. Instantiate an instance of the class and save it

What is the expected output? What do you see instead?
The table generated for the ivar will be named inter__cap instead of inter_cap. 
Later code 
expects the table to be named inter_cap.

The problem seems be in the + [SQLitePersistentObject tableCheck] method. On 
line 939 of this 
method, the property name is converted to a SQL Column name. Then, when dealing 
with the 
collection classes, the property name is _again_ converted to a SQL Column 
name, on lines 979 
(Arrays), 987 (Dictionaries), and 995 (Sets).

The conversion method looks to see if a character is equal to the uppercase 
instance of the 
character. In this case, there's no difference between an uppercase and 
lowercase '_' so the 
method inserts two '_' characters - one to indicate an intercap was found and 
one representing 
the 'lowercase' variant of the underscore.

The fix for this particular bug is not to double-convert the property name in 
the table check 
method. It may be better to change the stringAsSQLColumnName method to better 
handle this 
case in the future, however.

What version of the product are you using? On what operating system?


Please provide any additional information below.



Original issue reported on code.google.com by eric.s.blair on 4 Dec 2008 at 8:57

Memory map not being filled on load

I spotted an issue (or what I consider to be an issue) when loading the same 
object twice, which I 
had assumed the memory map would remember the object.

If you do something like:
Person *persona = [Person findByPK:1];
Person *personb = [Person findByPK:1];

Then persona != personb.

If you do:
Person *persona = [Person findByPK:1];
[persona save];
Person *personb = [Person findByPK:1];

Then persona == personb;


I checked through the code and I assume that it is because the memory map only 
gets filed when 
saving, not when loading. But surely we want to fill on load as well, otherwise 
it breaks the 
concept of having this memory map? No?

Original issue reported on code.google.com by [email protected] on 15 Feb 2009 at 7:39

Persistent object not being removed from in-memory cache after delete

What steps will reproduce the problem?
1. Save a persistent object
2. Query and show that object
3. Delete that persistent object
4. Query and show no objects
5. Save a new persistent object
6. Query and show that object
7. This "new" object is the old object cached

What is the expected output? What do you see instead?
Expect to see the new object. Instead, saw the old cached object. This is 
probably happening 
because the primary key is being reused when the new object is saved. Since the 
cache wasn't 
cleared of the deleted object, the old primary key is being found with the 
cached old object.

What version of the product are you using? On what operating system?
Latest from trunk.

Please provide any additional information below.
I added the following line of code at line 777 in SQLitePersistentObject.m:

[SQLitePersistentObject unregisterObject:self];

Right after it executes the delete query. This works but may not be the best 
way. For example, 
should child persistent objects also be removed from the cache?

Original issue reported on code.google.com by [email protected] on 27 Oct 2008 at 6:51

NSDate retreival issue + fix

Greets,

Apps were dying on retrieval of objects with NSDate* fields.  Tracked down
the problem to the last line of NSDate-SQLitePersistence.m's 

+(id)objectWithSqlColumnRepresentation:(NSString*)columnData

which was:

  return [dateFormatter dateFromString:self];

but self isn't actually a string, at least in my proggy... the fix seems to be:

  return [dateFormatter dateFromString:columnData];

Regards,
Pat Deegan

Original issue reported on code.google.com by [email protected] on 5 Nov 2008 at 9:32

property names that fail to save and/or load correctly

What steps will reproduce the problem?
1. create an object with property names starting with a capital letter or 
containing underscores
2. save the object
3. load the object 

What is the expected output? What do you see instead?
properties are not loaded from the database after saving




Original issue reported on code.google.com by [email protected] on 17 Jan 2009 at 2:42

Passing Incorrect Value in NSDate-SQLitePersistence [fix included]

What steps will reproduce the problem?
1. Read a NSDate value from the persistence object.

What do you see instead?
App crashes with error "+[NSDate length]: unrecognized selector sent to class"


How to Fix
==========

In NSDate-SQLitePersistence.m, on line 28, change:
return [dateFormatter dateFromString:self];

to : 
return [dateFormatter dateFromString:columnData];


Original issue reported on code.google.com by [email protected] on 7 Sep 2008 at 8:36

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.