-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Converting initial select queries to stored procedures
PostPosted: Tue Jan 23, 2007 4:33 pm 
Newbie

Joined: Tue Jan 23, 2007 4:58 am
Posts: 4
Hi,

Below is a debug hibernate log for when i call 3 stored procs to insert data into 3 tables. I was just wondering if there anyway at all that i can eliminate the calling of the in-line sql and the bindings , which are shown in red? or whether this is standard to persisting java objects to database via stored procedure calls in hibernate? The reason i need to know this is that on the database I will only have execute permissions via stored procedures, therefore all in-line sql needs to be removed.

Thanks in advance

Rich
----------

Hibernate version:3.2

Mapping documents:StaffValues.hbm.xml, StaffData.hbm.xml, Staff.hbm.xml

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:
17:16:21,000 INFO Environment:500 - Hibernate 3.2.0
17:16:21,016 INFO Environment:533 - hibernate.properties not found
17:16:21,047 INFO Environment:667 - Bytecode provider name : cglib
17:16:21,063 INFO Environment:584 - using JDK 1.4 java.sql.OutputTime handling
17:16:21,203 INFO Configuration:1350 - configuring from resource: /hibernate.cfg.xml
17:16:21,219 INFO Configuration:1327 - Configuration resource: /hibernate.cfg.xml
17:16:21,563 INFO Configuration:507 - Reading mappings from resource: Staff/StaffData.hbm.xml
17:16:21,797 INFO HbmBinder:300 - Mapping class: Staff.StaffData -> Staff_Data_Hib
17:16:21,844 INFO Configuration:507 - Reading mappings from resource: Staff/StaffValues.hbm.xml
17:16:21,891 INFO HbmBinder:300 - Mapping class: Staff.StaffValues -> Staff_Values_Hib
17:16:21,907 INFO Configuration:507 - Reading mappings from resource: Staff/Staff.hbm.xml
17:16:21,954 INFO HbmBinder:300 - Mapping class: Staff.Staff -> Staff_Hib
17:16:21,954 INFO Configuration:1465 - Configured SessionFactory: null
17:16:21,969 INFO HbmBinder:2375 - Mapping collection: Staff.StaffData.Staffs -> Staff_Hib
17:16:21,969 INFO HbmBinder:2375 - Mapping collection: Staff.StaffData.StaffValues -> Staff_Values_Hib
17:16:22,235 INFO PojoInstantiator:42 - no default (no-argument) constructor for class: Staff.StaffCompositeKey (class must be instantiated by Interceptor)

17:16:22,266 INFO PojoInstantiator:42 - no default (no-argument) constructor for class: Staff.ValueCompositeKey (class must be instantiated by Interceptor)

17:16:22,297 INFO C3P0ConnectionProvider:50 - C3P0 using driver: com.sybase.jdbc2.jdbc.SybDriver at URL: ************************************

17:16:22,297 INFO C3P0ConnectionProvider:51 - Connection properties: {user=****, password=****}
17:16:22,313 INFO C3P0ConnectionProvider:54 - autocommit mode: false
17:16:23,298 INFO SettingsFactory:81 - RDBMS: Adaptive Server Enterprise, version: Adaptive Server Enterprise/12.5.1/EBF 11429/P/Linux Intel/Enterprise Linux/ase1251/1823/32-bit/OPT/Tue Sep 16 23:43:54 2003

17:16:23,345 INFO SettingsFactory:82 - JDBC driver: jConnect (TM) for JDBC (TM), version: jConnect (TM) for JDBC(TM)/5.5(Build 25008)/P/JDK12/Tue May 29 14:37:46 2001

17:16:23,423 INFO Dialect:141 - Using dialect: org.hibernate.dialect.SybaseDialect
17:16:23,438 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
17:16:23,454 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)

17:16:23,454 INFO SettingsFactory:134 - Automatic flush during beforeCompletion(): disabled
17:16:23,470 INFO SettingsFactory:138 - Automatic session close at end of transaction: disabled
17:16:23,470 INFO SettingsFactory:153 - Scrollable result sets: enabled
17:16:23,470 INFO SettingsFactory:161 - JDBC3 getGeneratedKeys(): disabled
17:16:23,485 INFO SettingsFactory:169 - Connection release mode: auto
17:16:23,485 INFO SettingsFactory:196 - Default batch fetch size: 1
17:16:23,501 INFO SettingsFactory:200 - Generate SQL with comments: disabled
17:16:23,501 INFO SettingsFactory:204 - Order SQL updates by primary key: disabled
17:16:23,501 INFO SettingsFactory:369 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
17:16:23,517 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
17:16:23,532 INFO SettingsFactory:212 - Query language substitutions: {}
17:16:23,532 INFO SettingsFactory:217 - JPA-QL strict compliance: disabled
17:16:23,548 INFO SettingsFactory:222 - Second-level cache: enabled
17:16:23,548 INFO SettingsFactory:226 - Query cache: disabled
17:16:23,564 INFO SettingsFactory:356 - Cache provider: org.hibernate.cache.NoCacheProvider
17:16:23,564 INFO SettingsFactory:241 - Optimize cache for minimal puts: disabled
17:16:23,579 INFO SettingsFactory:250 - Structured second-level cache entries: disabled
17:16:23,595 INFO SettingsFactory:270 - Echoing all SQL to stdout
17:16:23,595 INFO SettingsFactory:277 - Statistics: disabled
17:16:23,610 INFO SettingsFactory:281 - Deleted entity synthetic identifier rollback: disabled
17:16:23,610 INFO SettingsFactory:296 - Default entity-mode: pojo
17:16:23,704 INFO SessionFactoryImpl:161 - building session factory
17:16:24,220 INFO PojoInstantiator:61 - no default (no-argument) constructor for class: Staff.StaffData (class must be instantiated by Interceptor)

17:16:24,408 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured

17:16:24,626 DEBUG SQL:393 - select Staffdata_.StaffId, Staffdata_.Flow as Flow0_, Staffdata_.WeekDay as WeekDay0_, Staffdata_.InputTime as InputTime0_, Staffdata_.OutputTime as OutputTime0_ from Staff_Data_Hib Staffdata_ where Staffdata_.StaffId=?

Hibernate: select Staffdata_.StaffId, Staffdata_.Flow as Flow0_, Staffdata_.WeekDay as WeekDay0_, Staffdata_.InputTime as InputTime0_, Staffdata_.OutputTime as OutputTime0_ from Staff_Data_Hib Staffdata_ where Staffdata_.StaffId=?

17:16:24,689 DEBUG StringType:80 - binding 'StaffID1' to parameter: 1
17:16:24,798 DEBUG SQL:393 - select Staff_.ShortName, Staff_.StaffId, Staff_.TimeTaken as TimeTaken2_ from Staff_Hib Staff_ where Staff_.ShortName=? and Staff_.StaffId=?

Hibernate: select Staff_.ShortName, Staff_.StaffId, Staff_.TimeTaken as TimeTaken2_ from Staff_Hib Staff_ where Staff_.ShortName=? and Staff_.StaffId=?

17:16:24,798 DEBUG StringType:80 - binding 'ShortName1' to parameter: 1
17:16:24,814 DEBUG StringType:80 - binding 'StaffID1' to parameter: 2
17:16:24,830 DEBUG SQL:393 - select Staff_.ShortName, Staff_.StaffId, Staff_.TimeTaken as TimeTaken2_ from Staff_Hib Staff_ where Staff_.ShortName=? and Staff_.StaffId=?

Hibernate: select Staff_.ShortName, Staff_.StaffId, Staff_.TimeTaken as TimeTaken2_ from Staff_Hib Staff_ where Staff_.ShortName=? and Staff_.StaffId=?

17:16:24,830 DEBUG StringType:80 - binding 'ShortName3' to parameter: 1
17:16:24,830 DEBUG StringType:80 - binding 'StaffID1' to parameter: 2
17:16:24,845 DEBUG SQL:393 - select Staff_.ShortName, Staff_.StaffId, Staff_.TimeTaken as TimeTaken2_ from Staff_Hib Staff_ where Staff_.ShortName=? and Staff_.StaffId=?

Hibernate: select Staff_.ShortName, Staff_.StaffId, Staff_.TimeTaken as TimeTaken2_ from Staff_Hib Staff_ where Staff_.ShortName=? and Staff_.StaffId=?

17:16:24,861 DEBUG StringType:80 - binding 'ShortName2' to parameter: 1
17:16:24,877 DEBUG StringType:80 - binding 'StaffID1' to parameter: 2
17:16:24,892 DEBUG SQL:393 - select Staffvalue_.KeyValue, Staffvalue_.ValueType, Staffvalue_.Value as Value1_ from Staff_Values_Hib Staffvalue_ where Staffvalue_.KeyValue=? and Staffvalue_.ValueType=?

Hibernate: select Staffvalue_.KeyValue, Staffvalue_.ValueType, Staffvalue_.Value as Value1_ from Staff_Values_Hib Staffvalue_ where Staffvalue_.KeyValue=? and Staffvalue_.ValueType=?

17:16:24,892 DEBUG StringType:80 - binding 'StaffID1' to parameter: 1
17:16:24,908 DEBUG StringType:80 - binding 'Staff_TYPE2' to parameter: 2
17:16:24,908 DEBUG SQL:393 - select Staffvalue_.KeyValue, Staffvalue_.ValueType, Staffvalue_.Value as Value1_ from Staff_Values_Hib Staffvalue_ where Staffvalue_.KeyValue=? and Staffvalue_.ValueType=?

Hibernate: select Staffvalue_.KeyValue, Staffvalue_.ValueType, Staffvalue_.Value as Value1_ from Staff_Values_Hib Staffvalue_ where Staffvalue_.KeyValue=? and Staffvalue_.ValueType=?

17:16:24,923 DEBUG StringType:80 - binding 'StaffID1' to parameter: 1
17:16:24,939 DEBUG StringType:80 - binding 'Staff_TYPE1' to parameter: 2
17:16:24,939 DEBUG SQL:393 - select Staffvalue_.KeyValue, Staffvalue_.ValueType, Staffvalue_.Value as Value1_ from Staff_Values_Hib Staffvalue_ where Staffvalue_.KeyValue=? and Staffvalue_.ValueType=?

Hibernate: select Staffvalue_.KeyValue, Staffvalue_.ValueType, Staffvalue_.Value as Value1_ from Staff_Values_Hib Staffvalue_ where Staffvalue_.KeyValue=? and Staffvalue_.ValueType=?

17:16:24,955 DEBUG StringType:80 - binding 'StaffID1' to parameter: 1
17:16:24,955 DEBUG StringType:80 - binding 'Staff_TYPE4' to parameter: 2
17:16:24,970 DEBUG SQL:393 - select Staffvalue_.KeyValue, Staffvalue_.ValueType, Staffvalue_.Value as Value1_ from Staff_Values_Hib Staffvalue_ where Staffvalue_.KeyValue=? and Staffvalue_.ValueType=?

Hibernate: select Staffvalue_.KeyValue, Staffvalue_.ValueType, Staffvalue_.Value as Value1_ from Staff_Values_Hib Staffvalue_ where Staffvalue_.KeyValue=? and Staffvalue_.ValueType=?

17:16:24,970 DEBUG StringType:80 - binding 'StaffID1' to parameter: 1
17:16:24,970 DEBUG StringType:80 - binding 'Staff_TYPE3' to parameter: 2
17:16:25,017 DEBUG SQL:393 - { call insert_Staff_data_hib ?, ?, ?, ?, ?, ? }
Hibernate: { call insert_Staff_data_hib ?, ?, ?, ?, ?, ? }
17:16:25,033 DEBUG StringType:80 - binding 'TestFlow' to parameter: 2
17:16:25,048 DEBUG OutputTimeType:80 - binding '2007-01-23 17:16:24' to parameter: 3
17:16:25,064 DEBUG OutputTimeType:80 - binding '2007-01-23 17:16:24' to parameter: 4
17:16:25,064 DEBUG OutputTimeType:80 - binding '2007-01-23 17:16:24' to parameter: 5
17:16:25,064 DEBUG StringType:80 - binding 'StaffID1' to parameter: 6
17:16:25,080 DEBUG SQL:393 - { call insert_Staff_hib ?, ?, ?, ? }
Hibernate: { call insert_Staff_hib ?, ?, ?, ? }
17:16:25,095 DEBUG FloatType:80 - binding '0.0' to parameter: 2
17:16:25,095 DEBUG StringType:80 - binding 'ShortName1' to parameter: 3
17:16:25,095 DEBUG StringType:80 - binding 'StaffID1' to parameter: 4
17:16:25,111 DEBUG SQL:393 - { call insert_Staff_hib ?, ?, ?, ? }
Hibernate: { call insert_Staff_hib ?, ?, ?, ? }
17:16:25,111 DEBUG FloatType:80 - binding '0.4062804' to parameter: 2
17:16:25,127 DEBUG StringType:80 - binding 'ShortName3' to parameter: 3
17:16:25,127 DEBUG StringType:80 - binding 'StaffID1' to parameter: 4
17:16:25,142 DEBUG SQL:393 - { call insert_Staff_hib ?, ?, ?, ? }
Hibernate: { call insert_Staff_hib ?, ?, ?, ? }
17:16:25,158 DEBUG FloatType:80 - binding '0.29043227' to parameter: 2
17:16:25,158 DEBUG StringType:80 - binding 'ShortName2' to parameter: 3
17:16:25,158 DEBUG StringType:80 - binding 'StaffID1' to parameter: 4
17:16:25,173 DEBUG SQL:393 - { call insert_Staff_values_hib ?, ?, ?, ? }
Hibernate: { call insert_Staff_values_hib ?, ?, ?, ? }
17:16:25,173 DEBUG StringType:80 - binding 'Value2' to parameter: 2
17:16:25,189 DEBUG StringType:80 - binding 'StaffID1' to parameter: 3
17:16:25,189 DEBUG StringType:80 - binding 'Staff_TYPE2' to parameter: 4
17:16:25,205 DEBUG SQL:393 - { call insert_Staff_values_hib ?, ?, ?, ? }
Hibernate: { call insert_Staff_values_hib ?, ?, ?, ? }
17:16:25,220 DEBUG StringType:80 - binding 'Value1' to parameter: 2
17:16:25,220 DEBUG StringType:80 - binding 'StaffID1' to parameter: 3
17:16:25,236 DEBUG StringType:80 - binding 'Staff_TYPE1' to parameter: 4
17:16:25,236 DEBUG SQL:393 - { call insert_Staff_values_hib ?, ?, ?, ? }
Hibernate: { call insert_Staff_values_hib ?, ?, ?, ? }
17:16:25,252 DEBUG StringType:80 - binding 'Value2' to parameter: 2
17:16:25,252 DEBUG StringType:80 - binding 'StaffID1' to parameter: 3
17:16:25,252 DEBUG StringType:80 - binding 'Staff_TYPE4' to parameter: 4
17:16:25,267 DEBUG SQL:393 - { call insert_Staff_values_hib ?, ?, ?, ? }
Hibernate: { call insert_Staff_values_hib ?, ?, ?, ? }
17:16:25,283 DEBUG StringType:80 - binding 'Value1' to parameter: 2
17:16:25,283 DEBUG StringType:80 - binding 'StaffID1' to parameter: 3
17:16:25,299 DEBUG StringType:80 - binding 'Staff_TYPE3' to parameter: 4
17:16:25,314 WARN JDBCExceptionReporter:48 - SQL Warning: 0, SQLState: 010TP
17:16:25,314 WARN JDBCExceptionReporter:49 - 010TP: The connection's initial character set, null, could not be converted by the server. The server's proposed character set, 8859_1, will be used, with conversions performed by jConnect.

17:16:25,330 INFO SessionFactoryImpl:767 - closing


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.