Example usage for org.hibernate TypeMismatchException TypeMismatchException

List of usage examples for org.hibernate TypeMismatchException TypeMismatchException

Introduction

In this page you can find the example usage for org.hibernate TypeMismatchException TypeMismatchException.

Prototype

public TypeMismatchException(String message) 

Source Link

Document

Constructs a TypeMismatchException using the supplied message.

Usage

From source file:com.createmobile.classicmodels.controller.ProductlinesController.java

License:Open Source License

@ApiOperation(value = "Retrieves content for the given BLOB field in Productlines instance")
@RequestMapping(value = "/{id}/content/{fieldName}", method = RequestMethod.GET, produces = "application/octet-stream")
@WMAccessVisibility(value = AccessSpecifier.APP_ONLY)
public DownloadResponse getProductlinesBLOBContent(@PathVariable("id") String id,
        @PathVariable("fieldName") String fieldName, HttpServletRequest httpServletRequest,
        HttpServletResponse httpServletResponse,
        @RequestParam(value = "download", defaultValue = "false") boolean download) {
    LOGGER.debug("Retrieves content for the given BLOB field {} in Productlines instance", fieldName);
    if (!WMRuntimeUtils.isLob(Productlines.class, fieldName)) {
        throw new TypeMismatchException("Given field " + fieldName + " is not a valid BLOB type");
    }//from  www  . ja  v a  2  s . c o m
    Productlines productlines = productlinesService.getById(id);
    return WMMultipartUtils.buildDownloadResponseForBlob(productlines, fieldName, httpServletRequest, download);
}

From source file:com.dbscenarios_30mar.classicmodels.controller.ProductlinesController.java

License:Open Source License

@RequestMapping(value = "/{id}/content/{fieldName}", method = RequestMethod.GET, produces = "application/octet-stream")
@ApiOperation(value = "Retrieves content for the given BLOB field in Productlines instance")
public DownloadResponse getProductlinesBLOBContent(@PathVariable("id") String id,
        @PathVariable("fieldName") String fieldName, HttpServletRequest httpServletRequest,
        HttpServletResponse httpServletResponse,
        @RequestParam(value = "download", defaultValue = "false") boolean download) {
    LOGGER.debug("Retrieves content for the given BLOB field {} in Productlines instance", fieldName);
    if (!WMRuntimeUtils.isLob(Productlines.class, fieldName)) {
        throw new TypeMismatchException("Given field " + fieldName + " is not a valid BLOB type");
    }//  w  ww .j a  v  a2  s. c o  m
    Productlines instance = productlinesService.findById(id);
    return WMMultipartUtils.buildDownloadResponseForBlob(instance, fieldName, httpServletRequest, download);
}

From source file:com.dbscenarios_30mar.dbtest_allscenarios.controller.AddressM1SpController.java

License:Open Source License

@RequestMapping(value = "/{id}/content/{fieldName}", method = RequestMethod.GET, produces = "application/octet-stream")
@ApiOperation(value = "Retrieves content for the given BLOB field in AddressM1Sp instance")
public DownloadResponse getAddressM1SpBLOBContent(@PathVariable("id") Integer id,
        @PathVariable("fieldName") String fieldName, HttpServletRequest httpServletRequest,
        HttpServletResponse httpServletResponse,
        @RequestParam(value = "download", defaultValue = "false") boolean download) {
    LOGGER.debug("Retrieves content for the given BLOB field {} in AddressM1Sp instance", fieldName);
    if (!WMRuntimeUtils.isLob(AddressM1Sp.class, fieldName)) {
        throw new TypeMismatchException("Given field " + fieldName + " is not a valid BLOB type");
    }//from w w w .j  a  v  a2  s . c  om
    AddressM1Sp instance = addressM1SpService.findById(id);
    return WMMultipartUtils.buildDownloadResponseForBlob(instance, fieldName, httpServletRequest, download);
}

From source file:com.dbscenarios_30mar.dbtest_allscenarios.controller.AllDbTypesController.java

License:Open Source License

@RequestMapping(value = "/{id}/content/{fieldName}", method = RequestMethod.GET, produces = "application/octet-stream")
@ApiOperation(value = "Retrieves content for the given BLOB field in AllDbTypes instance")
public DownloadResponse getAllDbTypesBLOBContent(@PathVariable("id") Integer id,
        @PathVariable("fieldName") String fieldName, HttpServletRequest httpServletRequest,
        HttpServletResponse httpServletResponse,
        @RequestParam(value = "download", defaultValue = "false") boolean download) {
    LOGGER.debug("Retrieves content for the given BLOB field {} in AllDbTypes instance", fieldName);
    if (!WMRuntimeUtils.isLob(AllDbTypes.class, fieldName)) {
        throw new TypeMismatchException("Given field " + fieldName + " is not a valid BLOB type");
    }//from   w w  w .  j  ava2  s.  c  o m
    AllDbTypes instance = allDbTypesService.findById(id);
    return WMMultipartUtils.buildDownloadResponseForBlob(instance, fieldName, httpServletRequest, download);
}

From source file:com.lsuc.lsuc.controller.LicenseephotoidcardController.java

License:Open Source License

@ApiOperation(value = "Retrieves content for the given BLOB field in Licenseephotoidcard instance")
@RequestMapping(value = "/{id}/content/{fieldName}", method = RequestMethod.GET, produces = "application/octet-stream")
@WMAccessVisibility(value = AccessSpecifier.APP_ONLY)
public DownloadResponse getLicenseephotoidcardBLOBContent(@PathVariable("id") Integer id,
        @PathVariable("fieldName") String fieldName, HttpServletRequest httpServletRequest,
        HttpServletResponse httpServletResponse,
        @RequestParam(value = "download", defaultValue = "false") boolean download) {

    LOGGER.debug("Retrieves content for the given BLOB field {} in Licenseephotoidcard instance", fieldName);

    if (!WMRuntimeUtils.isLob(Licenseephotoidcard.class, fieldName)) {
        throw new TypeMismatchException("Given field " + fieldName + " is not a valid BLOB type");
    }/*from ww  w  .j av  a2s  .  c  om*/
    Licenseephotoidcard licenseephotoidcard = licenseephotoidcardService.getById(id);

    return WMMultipartUtils.buildDownloadResponseForBlob(licenseephotoidcard, fieldName, httpServletRequest,
            download);
}

From source file:com.multiimages.employeesdb.controller.ImageController.java

License:Open Source License

@RequestMapping(value = "/{id}/content/{fieldName}", method = RequestMethod.GET)
@ApiOperation(value = "Retrieves content for the given BLOB field in Image instance")
public void getImageBLOBContent(@PathVariable("id") Integer id, @PathVariable("fieldName") String fieldName,
        HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
    LOGGER.debug("Retrieves content for the given BLOB field {} in Image instance", fieldName);
    if (!WMRuntimeUtils.isLob(Image.class, fieldName)) {
        throw new TypeMismatchException("Given field " + fieldName + " is not a valid BLOB type");
    }/* ww w . ja v a2 s  .c  o m*/
    Image instance = imageService.findById(id);
    WMMultipartUtils.buildHttpResponseForBlob(instance, fieldName, httpServletRequest, httpServletResponse);
}

From source file:com.portal.platform.controller.SysdiagramsController.java

License:Open Source License

@RequestMapping(value = "/{id}/content/{fieldName}", method = RequestMethod.GET, produces = "application/octet-stream")
@ApiOperation(value = "Retrieves content for the given BLOB field in Sysdiagrams instance")
public DownloadResponse getSysdiagramsBLOBContent(@PathVariable("id") Integer id,
        @PathVariable("fieldName") String fieldName, HttpServletRequest httpServletRequest,
        HttpServletResponse httpServletResponse,
        @RequestParam(value = "download", defaultValue = "false") boolean download) {
    LOGGER.debug("Retrieves content for the given BLOB field {} in Sysdiagrams instance", fieldName);
    if (!WMRuntimeUtils.isLob(Sysdiagrams.class, fieldName)) {
        throw new TypeMismatchException("Given field " + fieldName + " is not a valid BLOB type");
    }/*from w w  w . j a va2  s .c om*/
    Sysdiagrams sysdiagrams = sysdiagramsService.getById(id);
    return WMMultipartUtils.buildDownloadResponseForBlob(sysdiagrams, fieldName, httpServletRequest, download);
}

From source file:com.prod_2ndmar.dbscenarios.controller.AllTypesController.java

License:Open Source License

@ApiOperation(value = "Retrieves content for the given BLOB field in AllTypes instance")
@RequestMapping(value = "/{id}/content/{fieldName}", method = RequestMethod.GET, produces = "application/octet-stream")
@WMAccessVisibility(value = AccessSpecifier.APP_ONLY)
public DownloadResponse getAllTypesBLOBContent(@PathVariable("id") Integer id,
        @PathVariable("fieldName") String fieldName, HttpServletRequest httpServletRequest,
        HttpServletResponse httpServletResponse,
        @RequestParam(value = "download", defaultValue = "false") boolean download) {

    LOGGER.debug("Retrieves content for the given BLOB field {} in AllTypes instance", fieldName);

    if (!WMRuntimeUtils.isLob(AllTypes.class, fieldName)) {
        throw new TypeMismatchException("Given field " + fieldName + " is not a valid BLOB type");
    }// ww  w  .  ja v a2s. com
    AllTypes allTypes = allTypesService.getById(id);

    return WMMultipartUtils.buildDownloadResponseForBlob(allTypes, fieldName, httpServletRequest, download);
}

From source file:com.sample1.classicmodels.controller.ProductlinesController.java

License:Open Source License

@ApiOperation(value = "Retrieves content for the given BLOB field in Productlines instance")
@RequestMapping(value = "/{id}/content/{fieldName}", method = RequestMethod.GET, produces = "application/octet-stream")
@WMAccessVisibility(value = AccessSpecifier.APP_ONLY)
public DownloadResponse getProductlinesBLOBContent(@PathVariable("id") String id,
        @PathVariable("fieldName") String fieldName, HttpServletRequest httpServletRequest,
        HttpServletResponse httpServletResponse,
        @RequestParam(value = "download", defaultValue = "false") boolean download) {

    LOGGER.debug("Retrieves content for the given BLOB field {} in Productlines instance", fieldName);

    if (!WMRuntimeUtils.isLob(Productlines.class, fieldName)) {
        throw new TypeMismatchException("Given field " + fieldName + " is not a valid BLOB type");
    }/* w  ww  . j ava2s. c o  m*/
    Productlines productlines = productlinesService.getById(id);

    return WMMultipartUtils.buildDownloadResponseForBlob(productlines, fieldName, httpServletRequest, download);
}

From source file:com.sharedtestproject.sampledb33.controller.SampleController.java

License:Open Source License

@RequestMapping(value = "/{id}/content/{fieldName}", method = RequestMethod.GET, produces = "application/octet-stream")
@ApiOperation(value = "Retrieves content for the given BLOB field in Sample instance")
public DownloadResponse getSampleBLOBContent(@PathVariable("id") Integer id,
        @PathVariable("fieldName") String fieldName, HttpServletRequest httpServletRequest,
        HttpServletResponse httpServletResponse,
        @RequestParam(value = "download", defaultValue = "false") boolean download) {
    LOGGER.debug("Retrieves content for the given BLOB field {} in Sample instance", fieldName);
    if (!WMRuntimeUtils.isLob(Sample.class, fieldName)) {
        throw new TypeMismatchException("Given field " + fieldName + " is not a valid BLOB type");
    }/* ww w  .jav a  2 s .com*/
    Sample instance = sampleService.findById(id);
    return WMMultipartUtils.buildDownloadResponseForBlob(instance, fieldName, httpServletRequest, download);
}