{"record":{"id":"1cf9621ab051f8dc","repo":"hibernate/hibernate-orm","slug":"this-is-not-supported-yet","errorCode":null,"errorMessage":"This is not supported yet!","messagePattern":"This is not supported yet!","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/specification/internal/CountProjectionSpecificationImpl.java","lineNumber":42,"sourceCode":"import java.util.Map;\n\nimport static java.util.Collections.emptyMap;\n\n/**\n * @author Gavin King\n */\npublic class CountProjectionSpecificationImpl<T> implements SimpleProjectionSpecification<T,Long>, JpaTypedQueryReference<Long> {\n\n\tprivate final SelectionSpecification<T> selectionSpecification;\n\n\tpublic CountProjectionSpecificationImpl(@Nonnull SelectionSpecification<T> specification) {\n\t\tthis.selectionSpecification = specification;\n\t}\n\n\t@Nonnull\n\t@Override\n\tpublic QuerySpecification<T> restrict(@Nonnull Restriction<? super T> restriction) {\n\t\tthrow new UnsupportedOperationException( \"This is not supported yet!\" );\n\t}\n\n\t@Nonnull\n\t@Override\n\tpublic SelectionQuery<Long> createQuery(@Nonnull EntityHandler entityHandler) {\n\t\treturn entityHandler.unwrap( SharedSessionContract.class )\n\t\t\t\t.createQuery( buildCriteria( entityHandler.getCriteriaBuilder() ) );\n\t}\n\n\t@Nonnull\n\t@Override\n\tpublic CriteriaQuery<Long> buildCriteria(@Nonnull CriteriaBuilder builder) {\n\t\tvar impl = (SelectionSpecificationImpl<T>) selectionSpecification;\n\t\t// TODO: handle HQL, existing criteria\n\t\tfinal var tupleQuery =\n\t\t\t\t(SqmSelectStatement<Long>)\n\t\t\t\t\t\tbuilder.createQuery( getResultType() );\n\t\tfinal var root = tupleQuery.from( impl.getResultType() );","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/specification/internal/CountProjectionSpecificationImpl.java#L24-L60","documentation":"Error \"This is not supported yet!\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A code path that Hibernate has not implemented is exercised: This is not supported yet!","commonSituations":"Using newer/edge API features (certain projections, specifications, fetch mementos, composite-path native mappings, null keys in key-based pagination) that are present but not yet implemented.","solutions":["This count-projection specification operation is not supported yet. Use an equivalent explicit count query."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}