facebook

Hibernate and Oracle sequences

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #302616 Reply

    Deelow
    Member

    Hello….Hibernate newbie here. We have many tables in our Oracle database whose primary key is a number that has a corresponding sequence generator. For example, a table called MY_TABLE has a sequence called MY_TABLE_SEQ. How do I use the Hibernate reverse engineering in MyEclipse to correctly generate this? I don’t see anywhere in the wizard to enter the sequence name. Right now I’m hand-coding the sequences, but I have to do this every time I reverse engineer. Here’s what I need the annotations to look like (at least this seems to work):

    @SequenceGenerator(name = "MY_TABLE_SEQ", sequenceName = "MY_TABLE_SEQ")
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "MY_TABLE_SEQ")
    @Column(name = "SEQID", unique = true, nullable = false, precision = 15, scale = 0)
    

    Thank you,
    Justin

    #302658 Reply

    Brian Fernandes
    Moderator

    Justin,

    I’ll pass this on to the Persistence team, there does not seem to be a way in which you can specify these values during the RE process.

    We’ll try to support this in the upcoming 8.0 release.

    Sorry for the inconvenience caused.

    #335887 Reply

    Any update on this feature?

    #336059 Reply

    Brian Fernandes
    Moderator

    Krishna,

    I’m afraid this hasn’t yet been implemented as we have very few requests for this feature. I cannot suggest a workaround but will put this on a higher priority list for the MyEclipse 2013 enhancements.

    Sorry for the inconvenience caused.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Hibernate and Oracle sequences

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