I looked in the source code (I had to do it many times since the documentation is incomplete here and there):
from org.hibernate.CriteriaImpl:
...
public Criteria createAlias(String associationPath, String alias) {
return createAlias( associationPath, alias, INNER_JOIN );
}
public Criteria createAlias(String associationPath, String alias, int joinType) {
new Subcriteria( this, associationPath, alias, joinType );
return this;
}
public Criteria createCriteria(String associationPath) {
return createCriteria( associationPath, INNER_JOIN );
}
public Criteria createCriteria(String associationPath, int joinType) {
return new Subcriteria( this, associationPath, joinType );
}
public Criteria createCriteria(String associationPath, String alias) {
return createCriteria( associationPath, alias, INNER_JOIN );
}
public Criteria createCriteria(String associationPath, String alias, int joinType) {
return new Subcriteria( this, associationPath, alias, joinType );
}
..
it seems to me there is no implementation difference between createAlias() and createCriteria().
However, I don't know what difference there should be conceptually, if any.
|