The easiest solution is don't use Oracle. ;-) Or maybe use PostgreSQL
since that's very similar. In all seriousness, there should be an easy
way to solve this problem, but I don't know it. There is a
SequenceGenerator annotation - maybe that can be used somehow?
@Id
@SequenceGenerator(
name="EMP_SEQ_GEN",
sequenceName="emp_sequence"
)
@GeneratedValue(
strategy = GenerationType.SEQUENCE,
generator="EMP_SEQ_GEN"
)
public Integer getId() {
return this.id;
}
Matt
On 9/8/07, Rob Hills <[EMAIL PROTECTED]> wrote:
> Hi Matt,
>
> I've just bumped into this problem and wanted clarification of the suggested
> workaround.
>
> On 5 Sep 2007 at 22:26, Matt Raible wrote:
>
> > This might help:
> >
> > http://issues.appfuse.org/browse/APF-718
> >
> > <quote>
> > Set your hibernate_sequence to a high enough value so that future
> > insertions do not produce unique key constraint violations. For
> > instance, if your highest key value in any of your tables is 182974,
> > then the following statement would work for you -
> >
> > SQL> alter sequence hibernate_sequence increment by 182975 minvalue 0;
> > </quote>
>
> Are you saying that this needs to be done "manually" each time the DB is
> reloaded, or is there a way of including it somehow into a mvn jetty:run-war
> command (or whatever one uses to launch a project).
>
> Is it possible to include raw SQL commands in the sample-data.xml
> somehow?
>
> Cheers,
>
>
> Cheers,
> Rob Hills
> Waikiki, Western Australia
> Mobile +61 (412) 904-357
> Fax: +61 (8) 9529-2137
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
http://raibledesigns.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]