| I have a entity License with an @Filter definition with an SqlFragmentAlias using entity AllowedLicense.
@FilterDef( name = "license", parameters = {@ParamDef(name = "userId", type = "long")} ) @Filters({ @Filter(name = "license", condition = " {alias} .id = {allowed}.id and {allowed} .person_id=:userId", deduceAliasInjectionPoints = false, aliases= {@SqlFragmentAlias(alias="allowed", entity = AllowedLicense.class), @SqlFragmentAlias(alias="license", entity = License.class)} ) }) When hibernate creates the factory it blows up with an entity not found exception “License”: We are using JPA running in jBoss EAP 7 that uses hibernate 5.0 Both classes are defined in the persistence.xml file and what I see is that the metadata.getEntityBindings contains all of our classes. The problem arises in the SessionFactoryImpl constructor that loops through the metaData.entityBindings and then adds them to its own entityPersisters map. It first processes entity License and when it handles the filter it then throws that exception because it is looking into is own persisters map but entity 'AllowedLicense' has not been processes yet and thus is not in that map. I used your orm-5 template to reproduce the problem and will attach a zip of it. I also attach the full stack trace of the exception. bugs.tar.gz exception.txt |