openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miłosz Tylenda <mtyle...@o2.pl>
Subject Re: ID field auto generation issue for multiple databases supporting
Date Wed, 17 Jun 2009 07:25:37 GMT
Yu Wang,

Can we see your entity with "@GeneratedValue(strategy=GenerationType.AUTO)" and the stack
trace you are receiving with Derby?

Greetings,
Milosz


> Milosz,
> 
> I have tried "@GeneratedValue(strategy=GenerationType.AUTO)", it works
> fine for oracle but doesn't work for Derby.
> 
> Regards,
> Yu Wang
> 
> On Sat, Jun 13, 2009 at 7:19 PM, Miłosz Tylenda wrote:
> > Yu Wang,
> >
> > Try using "@GeneratedValue(strategy=GenerationType.AUTO)". This should automatically
pick up either IDENTITY or SEQUENCE depending on the database you are using.
> >
> > Cheers,
> > Milosz
> >
> >> Hello,
> >> I found If I user derby, I need to use
> >> "@GeneratedValue(strategy=GenerationType.IDENTITY)" for ID field.
> >> And for oracle database, I need to use
> >> "@GeneratedValue(strategy=GenerationType.SEQUENCE)".
> >>
> >> The question is if I want to use same entity classes to support both
> >> derby and oracle, how should I do?
> >> Do we have best practice for ID field value generation strategy for
> >> multiple databases supporting?
> >>
> >> Regards,
> >> Yu Wang
> >>
> >
> 

Mime
View raw message