Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 0.5.5-RC1
-
Component/s: None
-
Labels:None
Description
Part of the problem as described by DuyNguyen to the user mailing list:
I have the following domain class: Item, ItemWithPrice,
ItemWithPriceAndImage
I execute the following:
new ItemWithPriceAndImage(name: "Pen", price: 10, imageURL: "....").save()
I look up the database and see that the new record have price = NULL
Why didn't the price get inserted?
The "class" column of the database is set to ItemWithPriceAndImage, but I
think ItemWithPriceAndImage "is-a" ItemWithPrice, so every property should
be persisted as well.
Moreover, what if I add another class called
ItemWithPriceAndImageAndDescription?
class Item{
String name
}
class ItemWithPrice extends Item{
int price
}
class ItemWithPriceAndImage extends ItemWithPrice{
String imageURL
}
-------------
It's my (masukomi) opinion that anything deeper than one level of inheritence in domain models is just completely broken, as in just about everything that should come via inheritence doesn't.
Activity
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | master | cdb8fca... | 2007-04-15 17:52:08 -0700 | brownj / brownj | Added testPersistantPropertyInheritance in an attempt to identify what is going wrong with git-svn-id: https://svn.codehaus.org/grails/trunk@3811 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d |
| Files Changed | |||||
|
MODIFY
test/persistence/org/codehaus/groovy/grails/domain/DefaultGrailsDomainClassTests.java
|
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | cli-improvements | cdb8fca... | 2007-04-15 17:52:08 -0700 | brownj / brownj | Added testPersistantPropertyInheritance in an attempt to identify what is going wrong with git-svn-id: https://svn.codehaus.org/grails/trunk@3811 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d |
| Files Changed | |||||
|
MODIFY
test/persistence/org/codehaus/groovy/grails/domain/DefaultGrailsDomainClassTests.java
|
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.0.x | cdb8fca... | 2007-04-15 17:52:08 -0700 | brownj / brownj | Added testPersistantPropertyInheritance in an attempt to identify what is going wrong with git-svn-id: https://svn.codehaus.org/grails/trunk@3811 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d |
| Files Changed | |||||
|
MODIFY
test/persistence/org/codehaus/groovy/grails/domain/DefaultGrailsDomainClassTests.java
|
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | hibernate4 | cdb8fca... | 2007-04-15 17:52:08 -0700 | brownj / brownj | Added testPersistantPropertyInheritance in an attempt to identify what is going wrong with git-svn-id: https://svn.codehaus.org/grails/trunk@3811 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d |
| Files Changed | |||||
|
MODIFY
test/persistence/org/codehaus/groovy/grails/domain/DefaultGrailsDomainClassTests.java
|
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.1.x | cdb8fca... | 2007-04-15 17:52:08 -0700 | brownj / brownj | Added testPersistantPropertyInheritance in an attempt to identify what is going wrong with git-svn-id: https://svn.codehaus.org/grails/trunk@3811 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d |
| Files Changed | |||||
|
MODIFY
test/persistence/org/codehaus/groovy/grails/domain/DefaultGrailsDomainClassTests.java
|
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.2.x | cdb8fca... | 2007-04-15 17:52:08 -0700 | brownj / brownj | Added testPersistantPropertyInheritance in an attempt to identify what is going wrong with git-svn-id: https://svn.codehaus.org/grails/trunk@3811 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d |
| Files Changed | |||||
|
MODIFY
test/persistence/org/codehaus/groovy/grails/domain/DefaultGrailsDomainClassTests.java
|
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Closed [ 6 ] |
| Resolution | Fixed [ 1 ] | |
| Fix Version/s | 0.5.5 [ 13431 ] |
| Project Import | Thu Mar 24 21:22:24 CDT 2011 [ 1301019744151 ] |
| Workflow | jira [ 31438 ] | Grails [ 44336 ] |
| Workflow | Grails [ 44336 ] | Copy of Grails [ 51790 ] |
| Workflow | Copy of Grails [ 51790 ] | Grails [ 59200 ] |
| Workflow | Grails [ 59200 ] | Grails2 [ 66778 ] |
| Workflow | Grails2 [ 66778 ] | jira [ 76577 ] |
| Workflow | jira [ 76577 ] | Grails2 [ 85187 ] |
| Workflow | Grails2 [ 85187 ] | jira [ 93597 ] |
| Workflow | jira [ 93597 ] | Grails2 [ 101761 ] |