[
https://hibernate.onjira.com/browse/HHH-7161?page=com.atlassian.jira.plug...
]
Guenther Demetz edited comment on HHH-7161 at 3/12/12 3:05 AM:
---------------------------------------------------------------
Hi Steve,
Im doing nothing special, just trying to compile:
session.byId(C.class).load(id);
The problem stays in SessionImpl.java:
{noformat}
@Override
public IdentifierLoadAccess{noformat}{color:red}Impl{color}{noformat} byId(String
entityName) {
return new IdentifierLoadAccessImpl( entityName );
}
@Override
public IdentifierLoadAccessImpl byId(Class entityClass) {
return new IdentifierLoadAccessImpl( entityClass );
}
{noformat}
must be substituted with
{noformat}
@Override
public IdentifierLoadAccess byId(String entityName) {
return new IdentifierLoadAccessImpl( entityName );
}
@Override
public IdentifierLoadAccess byId(Class entityClass) {
return new IdentifierLoadAccessImpl( entityClass );
}
{noformat}
Then it works.
was (Author: pb00067):
Hi Steve,
Im doing nothing special, just trying to compile:
session.byId(C.class).load(id);
The problem stays in SessionImpl.java:
{noformat}
@Override
public IdentifierLoadAccessImpl byId(String entityName) {
return new IdentifierLoadAccessImpl( entityName );
}
@Override
public IdentifierLoadAccessImpl byId(Class entityClass) {
return new IdentifierLoadAccessImpl( entityClass );
}
{noformat}
must be substituted with
{noformat}
@Override
public IdentifierLoadAccess byId(String entityName) {
return new IdentifierLoadAccessImpl( entityName );
}
@Override
public IdentifierLoadAccess byId(Class entityClass) {
return new IdentifierLoadAccessImpl( entityClass );
}
{noformat}
Then it works.
The type SessionImpl.IdentifierLoadAccessImpl is not visible (not
public) so the new API session.byId(..) is not useable
------------------------------------------------------------------------------------------------------------------------
Key: HHH-7161
URL:
https://hibernate.onjira.com/browse/HHH-7161
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 4.1.0, 4.1.1
Reporter: Guenther Demetz
Priority: Minor
Labels: byId
Original Estimate: 1h
Remaining Estimate: 1h
Document
http://in.relation.to/Bloggers/41FeatureLoadingByNaturalId
says that the new approach has been made available for identifier based loading as well,
by listing following 2 new public methods:
public IdentifierLoadAccess byId(String entityName);
public IdentifierLoadAccess byId(Class entityClass);
Unfortunately IdentifierLoadAccess is a private inner class of SessionImpl so
session.byId(C.class).load(id);
gives following compile-error:
java.lang.Error: Unresolved compilation problem:
The type SessionImpl.IdentifierLoadAccessImpl is not visible
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira