http://helma.org/bugs/show_bug.cgi?id=656 Summary: Extended Prototypes objects do not return as correct
type
Product: Helma
Version: 1.6.3
Platform: All
OS/Version: All
Status: NEW
Severity: critical
Priority: P1
Component: Database Layer
AssignedTo:
helma-dev@...
ReportedBy:
maksim.lin@...
Seems that Prototypes that extend from another prototype are broken at the
moment, as when you fetch an object back from a SQL db, you get back an object
of the "supertype" ie. the Prototype that it extended from, rather then the
"subtype".
Eg.
Person.properties:
_db = testDB
_table = PERSON
_id = ID
name = NAME
Author.properties:
_extends = Person
_prototype = TYPE
bookid = BOOK_ID
Root.properties:
authors = collection(Author)
test.hac:
var nuAuthor = new Author();
nuAuthor.name = "Mr Test";
root.authors.add(nuAuthor);
Now if you run the above test action AND THEN flush the Helma app and do:
res.debug(root.authors.get(0))
you will get a Person object back, and Not a Author object.
Looking in the sql database, I can see the PERSON.TYPE columns values are being
correctly set to the correct subtype ("Author") but somewhere in the java
database layer code, the object is being created with the wrong type when its
data is retrieved from the DB - though I have not yet been able to find the
spot in the db layer code that does this.
--
Configure bugmail:
http://helma.org/bugs/userprefs.cgi?tab=email------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
Helma-dev mailing list
Helma-dev@...
http://helma.org/mailman/listinfo/helma-dev