<%_ if (position === 'import') { _%>
<%_ } _%>
<%_ if (position === 'method') { _%>

    /**
     * {@code PUT  /copy/:copyFromId} : copy from  an existing commonTableId.
     *
     * @param copyFromId the commonTableId to copy.
     * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated commonTableDTO,
     * or with status {@code 400 (Bad Request)} if the commonTableDTO is not valid,
     * or with status {@code 500 (Internal Server Error)} if the commonTableDTO couldn't be updated.
     * @throws URISyntaxException if the Location URI syntax is incorrect.
     */
    @PutMapping("/copy/{copyFromId}")
    public ResponseEntity<CommonTableDTO> updateCommonTable(@PathVariable <%= databaseTypeSql ? 'Long' : 'String' %> copyFromId) throws URISyntaxException {
        log.debug("REST request to copy CommonTable from id : {}", copyFromId);
        CommonTableDTO result = commonTableService.copyFromId(copyFromId).get();
        return ResponseEntity.ok()
            .headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, result.getId().toString()))
            .body(result);
    }

    /**
     * {@code GET  /entity-name/:entityName} : get the "entityName" commonTable.
     *
     * @param entityName the entityName of the commonTableDTO to retrieve.
     * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the commonTableDTO, or with status {@code 404 (Not Found)}.
     */
    @GetMapping("/entity-name/{entityName}")
    public ResponseEntity<CommonTableDTO> getByEntityName(@PathVariable String entityName) {
        log.debug("REST request to get CommonTable by entityName : {}", entityName);
        Optional<CommonTableDTO> commonTableDTO = commonTableService.findOneByEntityName(entityName);
        return ResponseUtil.wrapOrNotFound(commonTableDTO);
    }
<%_ } _%>
