{"record":{"id":"70ed04add8547cf0","repo":"quarkusio/quarkus","slug":"should-not-be-extended-or-implemented","errorCode":null,"errorMessage":" should not be extended or implemented","messagePattern":" should not be extended or implemented","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/panache/hibernate-reactive-rest-data-panache/deployment/src/main/java/io/quarkus/hibernate/reactive/rest/data/panache/deployment/HibernateReactivePanacheRestProcessor.java","lineNumber":139,"sourceCode":"                    new UnremovableBeanBuildItem.BeanClassNameExclusion(repositoryClassName)));\n\n            restDataResourceProducer.produce(new RestDataResourceBuildItem(\n                    new ResourceMetadata(resourceClass, resourceInterface, entityType, idType,\n                            getEntityFields(index, entityType))));\n        }\n    }\n\n    private void validateResource(IndexView index, ClassInfo classInfo) {\n        if (!Modifier.isInterface(classInfo.flags())) {\n            throw new RuntimeException(classInfo.name() + \" has to be an interface\");\n        }\n\n        if (classInfo.interfaceNames().size() > 1) {\n            throw new RuntimeException(classInfo.name() + \" should only extend REST Data Panache interface\");\n        }\n\n        if (!index.getKnownDirectImplementors(classInfo.name()).isEmpty()) {\n            throw new RuntimeException(classInfo.name() + \" should not be extended or implemented\");\n        }\n    }\n\n    private List<Type> getGenericTypes(ClassInfo classInfo) {\n        return classInfo.interfaceTypes()\n                .stream()\n                .findFirst()\n                .orElseThrow(() -> new RuntimeException(classInfo.toString() + \" does not have generic types\"))\n                .asParameterizedType()\n                .arguments();\n    }\n}\n","sourceCodeStart":121,"sourceCodeEnd":152,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/panache/hibernate-reactive-rest-data-panache/deployment/src/main/java/io/quarkus/hibernate/reactive/rest/data/panache/deployment/HibernateReactivePanacheRestProcessor.java#L121-L152","documentation":"REST Data Panache resource interfaces are terminal: the framework generates the only implementation, so subclasses or other implementors would conflict with generated code. The processor checks the Jandex index for known direct implementors and throws if any exist.","triggerScenarios":"A class or interface in the application index directly extends or implements an interface annotated with a REST Data Panache annotation.","commonSituations":"Trying to 'customize' a resource by extending the generated interface; creating an abstract base resource by implementing the annotated interface.","solutions":["Remove the implements/extends clause from your class or interface","Customize behavior via the backing repository/DAO instead of the resource interface","Write a separate JAX-RS resource for custom endpoints"],"exampleFix":"// before\npublic interface CustomCustomerResource extends CustomerResource {}\n// after: delete CustomCustomerResource; customize CustomerRepository instead","handlingStrategy":"validation","validationCode":"if (!index.getKnownDirectImplementors(DotName.createSimple(\"CustomerResource\")).isEmpty())\n    throw new IllegalStateException(\"REST Data Panache resource interfaces must not be implemented\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never implement or extend a @PanacheEntityResource/@PanacheRepositoryResource interface","Customize via repository classes instead","Keep custom endpoints in separate JAX-RS resources"],"tags":["quarkus","rest-data","panache","jandex"],"backgroundTag":"resource-interface-extended","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}