Hibernate with Oracle 11g not working with “select” generator?

I'm a bit unclear on what you mean by "The DBA has configured the sequences to not be viewable by the users they have created. " - does that mean that the sequence not visible to you? Why not?

I'm a bit unclear on what you mean by "The DBA has configured the sequences to not be viewable by the users they have created. " - does that mean that the sequence not visible to you? Why not?

In order to use sequence-based generator where sequence name is not "hibernate_sequence" (which it never is in real life; that's just the default) you need to specify the appropriate generator: @SequenceGenerator(name="myentity_seq", sequenceName="my_sequence") public class MyEntity { ... @Id @GeneratedValue(strategy=GenerationType. SEQUENCE, generator="myentity_seq") private Integer myEntityID; ... } "select" generator strategy means bernate will try to select the row you've just inserted using a unique key (other than PK, obviously). Do you have that defined?

I would strongly suggest you go with sequence instead.

Yes the DB team has made the sequences hidden from the usercodes they've given me, thus can't specify them in hibernate. I figure I'll have to go back to them to ask them to make them visible, but at the same time I came across the hanging issues while building the EntityManagerFactory so I was wondering if there was something I'm doing wrong there, aside from that I could choose a better option. – mushion22 Nov 26 '09 at 0:35 If you are going to use "select" strategy, you need to have a unique property on your entity defined as natural id and you need to pass it as parameter (with name "key") to @GenericGenerator you're defining.

Look at docs.jboss. Org/hibernate/stable/annotations/reference/en/html/… and docs.jboss. Org/hibernate/stable/core/reference/en/html/… (paragraph 5.1.4.6) – ChssPly76 Nov 26 '09 at 0:42 Ah I see ok.

I thought maybe bernate had a trick to be able to use getGeneratedKeys via JDBC seeing as I have that enabled. – mushion22 Nov 26 '09 at 1:12 getGeneratedKeys works for "sequence-identity" generator for Oracle10g dialect; however that still means you must have your sequence accessible – ChssPly76 Nov 26 '09 at 2:28 The DBA said they prefer not to make sequences visible for the case where someone selects it aside from an insert, therefore incrementing the sequence unnecessarily. I ended up using the class the guy wrote here forum.hibernate.Org/viewtopic.

Php? F=1&t=973262 which works well. This is the kind of behaviour I was hoping bernate would have built in when using getGeneratedKeys.

– mushion22 Nov 26 '09 at 22:51.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions