Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-RC3, 1.0-RC4
-
Fix Version/s: 1.0.2
-
Component/s: Persistence
-
Labels:None
-
Environment:Windows XP Pro, Grails 1.0RC4, Groovy 1.5.1
Description
From Mailing Group:
I have a "Superclass" called ConfigurationItem and a number of subclasses including one called Hardware. In addition, each Hardware has an associated HardwareType, so that each HardwareType has many Hardwares. I tried to change my inheritance strategy in ConfigurationItem to:
static mapping = {
tablePerHierarchy false
}
Now when I call:
hardwareType.hardwares
I get the following exception:
Column not found: HARDWARES0_.CLASS in statement [select hardwares0_.hardware_type_id as hardware2_1_, hardwares0_.id as id1_, hardwares0_.id as id14_0_, hardwares0_1_.version as version14_0_, hardwares0_1_.author as author14_0_, hardwares0_1_.description as descript4_14_0_, hardwares0_1_.name as name14_0_, hardwares0_1_.owner_email as owner6_14_0_, hardwares0_1_.owner_name as owner7_14_0_, hardwares0_1_.parent_id as parent8_14_0_, hardwares0_.hardware_type_id as hardware2_17_0_, hardwares0_.host_name as host3_17_0_, hardwares0_.internet_protocol_address as internet4_17_0_, hardwares0_.mac_address as mac5_17_0_, hardwares0_.purchase_date as purchase6_17_0_ from hardware hardwares0_ inner join configuration_item hardwares0_1_ on hardwares0_.id=hardwares0_1_.id where ( hardwares0_.class = 'Hardware') and hardwares0_.hardware_type_id=?]
It appears that it expects the "class" column that exists in the Hierarchy mapping.
I've attached the three domain objects.
Attachments
Issue Links
| This issue duplicates: | ||||
| GRAILS-2448 | tablePerHierarchy false & custom table name forces table name directive in subclasses |
|
|
|
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Bulk closing bunch of resolved issues