Last active
April 5, 2017 18:40
-
-
Save sebersole/63305e569308bf8bcc22e58c4e3897e7 to your computer and use it in GitHub Desktop.
Loader/Locker SPI proposal for 6.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hibernate.persister.exec.spi; | |
public interface CollectionLoader extends Loader { | |
// todo (6.0) - any (additional) Options info? | |
interface Options { | |
} | |
List load(Serializable key, SharedSessionContractImplementor session, Options options); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface CollectionPersister ... { | |
... | |
/** | |
* @todo (6.0) what args? | |
*/ | |
CollectionLoader getLoader(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hibernate.persister.exec.spi; | |
public interface EntityLocker { | |
// todo (6.0) - any additional Options info? | |
// - "scope"? | |
// - LockMode-by-alias map? | |
// - other flags (skip-locked, etc)? | |
// | |
// ^^ ideally have LockOptions somehow expose this info - less instantiations | |
interface Options { | |
/** | |
* Obtain the query timeout, in milliseconds. 0 = no wait; -1 = wait indefinitely | |
*/ | |
int getTimeout(); | |
} | |
void lock(Serializable id, Object version, Object object, SharedSessionContractImplementor session, Options options); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hibernate.persister.entity.spi; | |
public interface EntityPersister ... { | |
... | |
/** | |
* @todo (6.0) what args? | |
*/ | |
SingleIdEntityLoader getSingleIdLoader(); | |
/** | |
* @todo (6.0) what args? | |
*/ | |
MultiIdEntityLoader getMultiIdLoader(); | |
/** | |
* @todo (6.0) what args? | |
*/ | |
SingleUniqueKeyEntityLoader getSingleUniqueKeyLoader(); | |
/** | |
* @todo (6.0) what args? | |
*/ | |
EntityLocker getLocker(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hibernate.persister.exec.spi; | |
public interface Loader { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hibernate.persister.exec.spi; | |
public interface MultiIdEntityLoader extends Loader { | |
interface Options { | |
} | |
List load(List ids, SharedSessionContractImplementor session, Options options); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hibernate.persister.exec.spi; | |
public interface QueryLoader extends Loader { | |
interface Options { | |
// todo (6.0) parameters, etc? Or pass those in as explicit args? | |
} | |
List load(SharedSessionContractImplementor session, Options options); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hibernate.persister.exec.spi; | |
public interface SingleIdEntityLoader extends Loader { | |
interface Options { | |
/** | |
* The lock options for this load. May be {@code null}. | |
*/ | |
LockOptions getLockOptions(); | |
} | |
Object load(Serializable id, SharedSessionContractImplementor session, Options options); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hibernate.persister.exec.spi; | |
public interface SingleUniqueKeyEntityLoader extends Loader { | |
interface Options { | |
/** | |
* The lock options for this load. May be {@code null}. | |
*/ | |
LockOptions getLockOptions(); | |
} | |
Object load(Serializable uk, SharedSessionContractImplementor session, Options options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment