there is no class inheritance
but you are right: this is the whole code and logging; the other unexpected selects happen not when you get the location and group (many-to-many) but if you attach them to each other and save them, still aint sure why those other selects happen
Code:
Location location =
mockInfrastructureLookupServiceImpl.getLocation(34L);
LocationGroup group = mockInfrastructureLookupServiceImpl.getGroup(7L);
location.addGroup(group);
group.addLocation(location);
mockInfrastructureAdminServiceImpl.saveLocation(location);
this is the log
Code:
10:08:05,968 DEBUG [TestInfrastructureAdminServiceImpl] setUp() - start
10:08:05,968 INFO [SpringUnitContext] ====== START SETUP be.ugent.dgfb.cab.midtier.service.TestInfrastructureAdminServiceImpl ======
10:08:06,953 WARN [PropertyPlaceholderConfigurer] Could not load properties from URL [file:/C:/Documents and Settings/jdlandsh/dgfb-cab.properties]: C:\Documents and Settings\jdlandsh\dgfb-cab.properties (Het systeem kan het opgegeven bestand niet vinden)
10:08:06,953 WARN [PropertyPlaceholderConfigurer] Could not load properties from class path resource [webauth.properties]: class path resource [webauth.properties] cannot be opened because it does not exist
10:08:07,031 WARN [PropertyPlaceholderConfigurer] Could not load properties from URL [file:/C:/Documents and Settings/jdlandsh/webauth.properties]: C:\Documents and Settings\jdlandsh\webauth.properties (Het systeem kan het opgegeven bestand niet vinden)
10:08:09,937 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
10:08:10,125 DEBUG [CacheManager] Creating new CacheManager with default config
10:08:10,140 DEBUG [CacheManager] Configuring ehcache from classpath.
10:08:10,156 WARN [Configurator] No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Documents%20and%20Settings/jdlandsh/.m2/repository/ehcache/ehcache/1.1/ehcache-1.1.jar!/ehcache-failsafe.xml
10:08:10,500 DEBUG [Configuration$DiskStore] Disk Store Path: C:\DOCUME~1\jdlandsh\LOCALS~1\Temp\
10:08:15,234 DEBUG [SpringUnitContext] getBean(String) - start
10:08:15,234 DEBUG [SpringUnitContext] getBean(String) - end
10:08:15,328 INFO [SpringUnitContext] ====== END SETUP be.ugent.dgfb.cab.midtier.service.TestInfrastructureAdminServiceImpl ======
10:08:15,328 DEBUG [SpringUnitContext] getBean(String) - start
10:08:15,328 DEBUG [SpringUnitContext] getBean(String) - end
10:08:15,328 DEBUG [SpringUnitContext] getBean(String) - start
10:08:15,328 DEBUG [SpringUnitContext] getBean(String) - end
10:08:15,328 DEBUG [TestInfrastructureAdminServiceImpl] setUp() - end
10:08:15,328 DEBUG [TestInfrastructureAdminServiceImpl] testBatch4() - start
10:08:15,781 DEBUG [SQL]
/* load be.ugent.dgfb.cab.model.infrastructure.LocationGroup */ select
locationgr0_.id as id4_0_,
locationgr0_.version as version4_0_,
locationgr0_.description as descript3_4_0_,
locationgr0_.name as name4_0_
from
INF_LOCATIONGROUP locationgr0_
where
locationgr0_.id=?
10:08:15,812 DEBUG [LongType] binding '7' to parameter: 1
10:08:15,828 DEBUG [LongType] returning '0' as column: version4_0_
10:08:15,828 DEBUG [StringType] returning 'group' as column: descript3_4_0_
10:08:15,828 DEBUG [StringType] returning 'group-name' as column: name4_0_
10:08:15,890 DEBUG [SQL]
/* load collection be.ugent.dgfb.cab.model.infrastructure.LocationGroup.locations */ select
locations0_.locationgroup_id_ref as location2_1_,
locations0_.location_id_ref as location1_1_,
location1_.id as id3_0_,
location1_.city as city3_0_,
location1_.postalCode as postalCode3_0_,
location1_.street as street3_0_,
location1_.streetNumber as streetNu5_3_0_,
location1_.rentable as rentable3_0_,
location1_.reservable as reservable3_0_,
location1_.campus_id_ref as campus12_3_0_,
location1_.maximumCapacity as maximumC8_3_0_,
location1_.version as version3_0_,
location1_.description as descrip10_3_0_,
location1_.name as name3_0_
from
INF_LOCATION_GROUPS locations0_
left outer join
INF_LOCATION location1_
on locations0_.location_id_ref=location1_.id
where
locations0_.locationgroup_id_ref=?
10:08:15,890 DEBUG [LongType] binding '7' to parameter: 1
10:08:15,890 DEBUG [LongType] returning '34' as column: id3_0_
10:08:15,890 DEBUG [StringType] returning null as column: city3_0_
10:08:15,890 DEBUG [StringType] returning null as column: postalCode3_0_
10:08:15,890 DEBUG [StringType] returning null as column: street3_0_
10:08:15,890 DEBUG [StringType] returning null as column: streetNu5_3_0_
10:08:15,890 DEBUG [BooleanType] returning 'true' as column: rentable3_0_
10:08:15,890 DEBUG [BooleanType] returning 'true' as column: reservable3_0_
10:08:15,890 DEBUG [LongType] returning null as column: campus12_3_0_
10:08:15,890 DEBUG [IntegerType] returning '10' as column: maximumC8_3_0_
10:08:15,890 DEBUG [LongType] returning '0' as column: version3_0_
10:08:15,890 DEBUG [StringType] returning 'desc' as column: descrip10_3_0_
10:08:15,890 DEBUG [StringType] returning 'NAME' as column: name3_0_
10:08:15,890 DEBUG [LongType] returning '7' as column: location2_1_
10:08:15,890 DEBUG [LongType] returning '34' as column: location1_1_
10:08:15,890 DEBUG [SQL]
/* load be.ugent.dgfb.cab.model.infrastructure.fmis.FmisData */ select
fmisdata0_.id as id9_0_,
fmisdata0_.area as area9_0_,
fmisdata0_.buildingId as buildingId9_0_,
fmisdata0_.campusId as campusId9_0_,
fmisdata0_.floorId as floorId9_0_,
fmisdata0_.roomFullId as roomFullId9_0_,
fmisdata0_.roomId as roomId9_0_,
fmisdata0_.roomType as roomType9_0_
from
INF_FMIS_DATA fmisdata0_
where
fmisdata0_.id=?
10:08:15,906 DEBUG [LongType] binding '34' to parameter: 1
10:08:15,921 DEBUG [SQL]
/* load collection be.ugent.dgfb.cab.model.infrastructure.Location.equipment */ select
equipment0_.location_id_ref as location1_1_,
equipment0_.equipment_id_ref as equipment2_1_,
equipment1_.id as id1_0_,
equipment1_.version as version1_0_,
equipment1_.description as descript3_1_0_,
equipment1_.name as name1_0_
from
INF_LOCATION_EQUIPMENT equipment0_
left outer join
INF_EQUIPMENT equipment1_
on equipment0_.equipment_id_ref=equipment1_.id
where
equipment0_.location_id_ref=?
10:08:15,921 DEBUG [LongType] binding '34' to parameter: 1
10:08:15,921 DEBUG [SQL]
/* load collection be.ugent.dgfb.cab.model.infrastructure.Location.groups */ select
groups0_.location_id_ref as location1_1_,
groups0_.locationgroup_id_ref as location2_1_,
locationgr1_.id as id4_0_,
locationgr1_.version as version4_0_,
locationgr1_.description as descript3_4_0_,
locationgr1_.name as name4_0_
from
INF_LOCATION_GROUPS groups0_
left outer join
INF_LOCATIONGROUP locationgr1_
on groups0_.locationgroup_id_ref=locationgr1_.id
where
groups0_.location_id_ref=?
10:08:15,921 DEBUG [LongType] binding '34' to parameter: 1
10:08:15,921 DEBUG [LongType] returning '7' as column: id4_0_
10:08:15,921 DEBUG [LongType] returning '34' as column: location1_1_
10:08:15,921 DEBUG [LongType] returning '7' as column: location2_1_
10:08:15,937 DEBUG [SQL]
/* load one-to-many be.ugent.dgfb.cab.model.infrastructure.Location.managers */ select
managers0_.location_id_ref as location7_1_,
managers0_.id as id1_,
managers0_.id as id5_0_,
managers0_.employee_id_ref as employee6_5_0_,
managers0_.location_id_ref as location7_5_0_,
managers0_.version as version5_0_,
managers0_.managerType as managerT3_5_0_,
managers0_.endDate as endDate5_0_,
managers0_.startDate as startDate5_0_
from
INF_MANAGER managers0_
where
managers0_.location_id_ref=?
10:08:15,937 DEBUG [LongType] binding '34' to parameter: 1
10:08:15,937 DEBUG [SQL]
/* load collection be.ugent.dgfb.cab.model.infrastructure.Location.notifications */ select
notificati0_.location_id_ref as location1_1_,
notificati0_.notification_id_ref as notifica2_1_,
notificati1_.id as id6_0_,
notificati1_.version as version6_0_,
notificati1_.endDate as endDate6_0_,
notificati1_.startDate as startDate6_0_,
notificati1_.message as message6_0_
from
INF_LOCATION_NOTIFICATIONS notificati0_
left outer join
INF_NOTIFICATION notificati1_
on notificati0_.notification_id_ref=notificati1_.id
where
notificati0_.location_id_ref=?
10:08:15,937 DEBUG [LongType] binding '34' to parameter: 1
10:08:15,937 DEBUG [SQL]
/* load one-to-many be.ugent.dgfb.cab.model.infrastructure.Location.pictures */ select
pictures0_.location_id_ref as location8_1_,
pictures0_.id as id1_,
pictures0_.id as id7_0_,
pictures0_.height as height7_0_,
pictures0_.width as width7_0_,
pictures0_.location_id_ref as location8_7_0_,
pictures0_.version as version7_0_,
pictures0_.image_encoding as image5_7_0_,
pictures0_.name as name7_0_,
pictures0_.image as image7_0_
from
INF_PICTURE pictures0_
where
pictures0_.location_id_ref=?
10:08:15,937 DEBUG [LongType] binding '34' to parameter: 1
10:08:15,937 DEBUG [SQL]
/* load collection be.ugent.dgfb.cab.model.infrastructure.Location.requests */ select
requests0_.location_id_ref as location1_1_,
requests0_.request_id_ref as request2_1_,
request1_.id as id8_0_,
request1_.version as version8_0_,
request1_.description as descript3_8_0_,
request1_.name as name8_0_
from
INF_LOCATION_REQUESTS requests0_
left outer join
INF_REQUEST request1_
on requests0_.request_id_ref=request1_.id
where
requests0_.location_id_ref=?
10:08:15,937 DEBUG [LongType] binding '34' to parameter: 1
10:08:15,953 DEBUG [TestInfrastructureAdminServiceImpl] testBatch4() - end
10:08:15,953 DEBUG [TestInfrastructureAdminServiceImpl] tearDown() - start
10:08:15,953 INFO [SpringUnitContext] ====== START TEARDOWN be.ugent.dgfb.cab.midtier.service.TestInfrastructureAdminServiceImpl ======
10:08:15,968 INFO [SpringUnitContext] ====== END TEARDOWN be.ugent.dgfb.cab.midtier.service.TestInfrastructureAdminServiceImpl ======
10:08:15,968 DEBUG [TestInfrastructureAdminServiceImpl] tearDown() - end
[/code]