facebook

postgresql int8 data type mapping during CRUD scaffolding

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #320063 Reply

    Andy Gorman
    Participant

    The Scaffold Spring CRUD Application process, is mapping postgresql int8 to a java Integer, when it should be a BigInteger. I am specifying the postgresql dialect in the process (but I’m not sure if that is relevant).

    Rather than trying to go through all the code fixing the problem, I know there should be a way to override the default mappings. Can someone point me in the right direction?

    Andy

    #320211 Reply

    jayperkins
    Member

    Unfortunately, we always create an integer for numeric columns, even for long types reported by the database. This is most likely due to the fact that at one point a long time ago we did not support long fields. This is a bug and a JIRA has been created.

    In the meantime, I have attached a customization project that overrides the default behavior. Basically, I added custom code that looks at the precision of numeric columns to determine thier java type.

    Follow the steps below to use the customization project when you perform crud scaffolding.

    First, import the attached project.

    To customize a specific project, right click on the project that you will be scaffolding into and select the Properties menu item. Navigate to MyEclipse -> Customization. Click on the Add… button and select the customization project that you imported.

    To customize all projects that you will be scaffolding into, select the Window -> Preferences menu item. Navigate to MyEclipse -> Spring Code Generation -> Customization. Click on the Add… button and select the customization project that you imported.

    Now try to scaffold and see if you are getting the correct java types for your larger numeric columns.

    Attachments:
    You must be logged in to view attached files.
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: postgresql int8 data type mapping during CRUD scaffolding

You must be logged in to post in the forum log in