20
20
import org .hibernate .graph .RootGraph ;
21
21
import org .hibernate .jdbc .ReturningWork ;
22
22
import org .hibernate .jdbc .Work ;
23
- import org .hibernate .jpa .HibernateEntityManager ;
24
23
import org .hibernate .stat .SessionStatistics ;
25
24
26
25
/**
@@ -235,7 +234,7 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
235
234
*
236
235
* To override this session's read-only/modifiable setting for entities
237
236
* and proxies loaded by a Query:
238
- * @see Query#setReadOnly(boolean)
237
+ * @see org.hibernate.query. Query#setReadOnly(boolean)
239
238
*
240
239
* @param readOnly true, the default for loaded entities/proxies is read-only;
241
240
* false, the default for loaded entities/proxies is modifiable
@@ -252,7 +251,7 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
252
251
* @throws TransientObjectException if the instance is transient or associated with
253
252
* a different session
254
253
*/
255
- Serializable getIdentifier (Object object );
254
+ Object getIdentifier (Object object );
256
255
257
256
/**
258
257
* Check if this entity is associated with this Session. This form caters to
@@ -281,17 +280,17 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
281
280
* Return the persistent instance of the given entity class with the given identifier,
282
281
* obtaining the specified lock mode, assuming the instance exists.
283
282
* <p/>
284
- * Convenient form of {@link #load(Class, Serializable , LockOptions)}
283
+ * Convenient form of {@link #load(Class, Object , LockOptions)}
285
284
*
286
285
* @param theClass a persistent class
287
286
* @param id a valid identifier of an existing persistent instance of the class
288
287
* @param lockMode the lock level
289
288
*
290
289
* @return the persistent instance or proxy
291
290
*
292
- * @see #load(Class, Serializable , LockOptions)
291
+ * @see #load(Class, Object , LockOptions)
293
292
*/
294
- <T > T load (Class <T > theClass , Serializable id , LockMode lockMode );
293
+ <T > T load (Class <T > theClass , Object id , LockMode lockMode );
295
294
296
295
/**
297
296
* Return the persistent instance of the given entity class with the given identifier,
@@ -302,23 +301,23 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
302
301
* @param lockOptions contains the lock level
303
302
* @return the persistent instance or proxy
304
303
*/
305
- <T > T load (Class <T > theClass , Serializable id , LockOptions lockOptions );
304
+ <T > T load (Class <T > theClass , Object id , LockOptions lockOptions );
306
305
307
306
/**
308
307
* Return the persistent instance of the given entity class with the given identifier,
309
308
* obtaining the specified lock mode, assuming the instance exists.
310
309
* <p/>
311
- * Convenient form of {@link #load(String, Serializable , LockOptions)}
310
+ * Convenient form of {@link #load(String, Object , LockOptions)}
312
311
*
313
312
* @param entityName a persistent class
314
313
* @param id a valid identifier of an existing persistent instance of the class
315
314
* @param lockMode the lock level
316
315
*
317
316
* @return the persistent instance or proxy
318
317
*
319
- * @see #load(String, Serializable , LockOptions)
318
+ * @see #load(String, Object , LockOptions)
320
319
*/
321
- Object load (String entityName , Serializable id , LockMode lockMode );
320
+ Object load (String entityName , Object id , LockMode lockMode );
322
321
323
322
/**
324
323
* Return the persistent instance of the given entity class with the given identifier,
@@ -330,7 +329,7 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
330
329
*
331
330
* @return the persistent instance or proxy
332
331
*/
333
- Object load (String entityName , Serializable id , LockOptions lockOptions );
332
+ Object load (String entityName , Object id , LockOptions lockOptions );
334
333
335
334
/**
336
335
* Return the persistent instance of the given entity class with the given identifier,
@@ -346,7 +345,7 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
346
345
*
347
346
* @return the persistent instance or proxy
348
347
*/
349
- <T > T load (Class <T > theClass , Serializable id );
348
+ <T > T load (Class <T > theClass , Object id );
350
349
351
350
/**
352
351
* Return the persistent instance of the given entity class with the given identifier,
@@ -362,16 +361,13 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
362
361
*
363
362
* @return the persistent instance or proxy
364
363
*/
365
- Object load (String entityName , Serializable id );
364
+ Object load (String entityName , Object id );
366
365
367
366
/**
368
367
* Read the persistent state associated with the given identifier into the given transient
369
368
* instance.
370
- *
371
- * @param object an "empty" instance of the persistent class
372
- * @param id a valid identifier of an existing persistent instance of the class
373
369
*/
374
- void load (Object object , Serializable id );
370
+ void load (Object object , Object id );
375
371
376
372
/**
377
373
* Persist the state of the given detached instance, reusing the current
@@ -404,7 +400,7 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
404
400
*
405
401
* @return the generated identifier
406
402
*/
407
- Serializable save (Object object );
403
+ Object save (Object object );
408
404
409
405
/**
410
406
* Persist the given transient instance, first assigning a generated identifier. (Or
@@ -417,7 +413,7 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
417
413
*
418
414
* @return the generated identifier
419
415
*/
420
- Serializable save (String entityName , Object object );
416
+ Object save (String entityName , Object object );
421
417
422
418
/**
423
419
* Either {@link #save(Object)} or {@link #update(Object)} the given
@@ -693,25 +689,25 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
693
689
*
694
690
* @return a persistent instance or null
695
691
*/
696
- <T > T get (Class <T > entityType , Serializable id );
692
+ <T > T get (Class <T > entityType , Object id );
697
693
698
694
/**
699
695
* Return the persistent instance of the given entity class with the given identifier,
700
696
* or null if there is no such persistent instance. (If the instance is already associated
701
697
* with the session, return that instance. This method never returns an uninitialized instance.)
702
698
* Obtain the specified lock mode if the instance exists.
703
699
* <p/>
704
- * Convenient form of {@link #get(Class, Serializable , LockOptions)}
700
+ * Convenient form of {@link #get(Class, Object , LockOptions)}
705
701
*
706
702
* @param entityType The entity type
707
703
* @param id an identifier
708
704
* @param lockMode the lock mode
709
705
*
710
706
* @return a persistent instance or null
711
707
*
712
- * @see #get(Class, Serializable , LockOptions)
708
+ * @see #get(Class, Object , LockOptions)
713
709
*/
714
- <T > T get (Class <T > entityType , Serializable id , LockMode lockMode );
710
+ <T > T get (Class <T > entityType , Object id , LockMode lockMode );
715
711
716
712
/**
717
713
* Return the persistent instance of the given entity class with the given identifier,
@@ -725,7 +721,7 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
725
721
*
726
722
* @return a persistent instance or null
727
723
*/
728
- <T > T get (Class <T > entityType , Serializable id , LockOptions lockOptions );
724
+ <T > T get (Class <T > entityType , Object id , LockOptions lockOptions );
729
725
730
726
/**
731
727
* Return the persistent instance of the given named entity with the given identifier,
@@ -737,23 +733,23 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
737
733
*
738
734
* @return a persistent instance or null
739
735
*/
740
- Object get (String entityName , Serializable id );
736
+ Object get (String entityName , Object id );
741
737
742
738
/**
743
739
* Return the persistent instance of the given entity class with the given identifier,
744
740
* or null if there is no such persistent instance. (If the instance is already associated
745
741
* with the session, return that instance. This method never returns an uninitialized instance.)
746
742
* Obtain the specified lock mode if the instance exists.
747
743
* <p/>
748
- * Convenient form of {@link #get(String, Serializable , LockOptions)}
744
+ * Convenient form of {@link #get(String, Object , LockOptions)}
749
745
*
750
746
* @param entityName the entity name
751
747
* @param id an identifier
752
748
* @param lockMode the lock mode
753
749
*
754
750
* @return a persistent instance or null
755
751
*
756
- * @see #get(String, Serializable , LockOptions)
752
+ * @see #get(String, Object , LockOptions)
757
753
*/
758
754
Object get (String entityName , Serializable id , LockMode lockMode );
759
755
@@ -769,7 +765,7 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
769
765
*
770
766
* @return a persistent instance or null
771
767
*/
772
- Object get (String entityName , Serializable id , LockOptions lockOptions );
768
+ Object get (String entityName , Object id , LockOptions lockOptions );
773
769
774
770
/**
775
771
* Return the entity name for a persistent entity.
@@ -936,7 +932,7 @@ public interface Session extends SharedSessionContract, EntityManager, AutoClose
936
932
*
937
933
* To override this session's read-only/modifiable setting for entities
938
934
* and proxies loaded by a Query:
939
- * @see Query#setReadOnly(boolean)
935
+ * @see org.hibernate.query. Query#setReadOnly(boolean)
940
936
*
941
937
* @param entityOrProxy an entity or HibernateProxy
942
938
* @param readOnly {@code true} if the entity or proxy should be made read-only; {@code false} if the entity or
0 commit comments