RafficMaleo / android-active-record

Automatically exported from code.google.com/p/android-active-record
0 stars 0 forks source link

Cannot create a One-to-Many Relationship #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Have two classes where one can have a list of the other (ex. Keychain, Key)
2. Use a List to store to the to-many objects (List<Key> keys)
3. Try to run a test with these objects

What is the expected output? What do you see instead?
java.lang.IllegalArgumentException: Class cannot be stored in Sqlite3 database.
at org.kroz.activerecord.Database.getSQLiteTypeString(Database.java:381)
at org.kroz.activerecord.DatabaseBuilder.getSQLCreate(DatabaseBuilder.java:90)
at org.kroz.activerecord.DatabaseOpenHelper.onCreate(DatabaseOpenHelper.java:42)
at 
android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.ja
va:106)
at 
android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.ja
va:158)
at org.kroz.activerecord.Database.open(Database.java:136)
at org.kroz.activerecord.ActiveRecordBase.open(ActiveRecordBase.java:58)
at 
com.shopify.mobileandroid.test.product.ProductTest.setUpDatabase(ProductTest.jav
a:65)
at com.shopify.mobileandroid.test.product.ProductTest.setUp(ProductTest.java:55)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
at 
android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:43
0)
at 
android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)

What version of the product are you using? On what operating system?
android-active-record - Trunk
android 2.1-update1

Please provide any additional information below.
It would be nice to have the class gracefully handle the creation of an 
intermediate table to store the relationship between the classes.

Would the use of annotations make this easier?
ie. @HasMany(class = Keys.class, name="keys")

Original issue reported on code.google.com by c.saunde...@gmail.com on 20 Jan 2011 at 7:26

GoogleCodeExporter commented 8 years ago
This will be enhancement in the next release

Original comment by Vladimir.Kroz on 29 Mar 2011 at 8:41

GoogleCodeExporter commented 8 years ago
Hi Vladimir, any news about this issue?

Original comment by porcelli...@gmail.com on 9 Apr 2012 at 6:37