Announcement Announcement Module
Collapse
No announcement yet.
How do I tell DBRE that an entity property should be Long instead of BigDecimal? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I tell DBRE that an entity property should be Long instead of BigDecimal?

    I'm using Roo DBRE with Oracle 11g. I want it to generate certain domain entity properties as Long or Integer. But no mater what I set the data type in the database to they always come out as BigDecimal. I have tried NUMBER(38) and NUMBER(10). It doesn't seem to make a difference. I can set the data type of the Id field with the RooJpaActiveRecord annotation by adding identifierType=java.lang.Long.class. But I can't figure out how to set the property types.

    Is it possible to do that?
    Last edited by cygnosis; Jun 19th, 2013, 08:03 PM.

  • #2
    Use the @Column annotation.

    Comment


    • #3
      So, if I can read a bit into your reply, you're saying that DBRE with Oracle will always produce a BigDecimal type for a NUMBER column. And if I want the type to be different I have to pull it out of the generated code, @Column annotation included, and change the type myself.

      I think BigDecimal is an odd choice for a use-in-all-cases default. But the solution works, and a DBRE round-trip doesn't change it back.

      Thanks for the reply.

      Comment

      Working...
      X