@GeneratedValue(strategy = GenerationType.AUTO)

View: New views
6 Messages — Rating Filter:   Alert me  

@GeneratedValue(strategy = GenerationType.AUTO)

by El Arbi Aboussoror :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
When I try to store one of my entities that uses the annotation
@GeneratedValue(strategy = GenerationType.AUTO) on the "id" field I get this
error:

*[EL Info]: 2009-10-21 18:47:35.337--ServerSession(6451154)--EclipseLink,
version: Eclipse Persistence Services - 1.1.2.v20090612-r4475
[EL Info]: 2009-10-21
18:47:35.976--ServerSession(6451154)--file:/G:/data/eclipse/workspace_0/Educa-EJB/build/classes/-educaPU
login successful
[EL Warning]: 2009-10-21 18:47:36.054--ClientSession(2003839)--Exception
[EclipseLink-4002] (Eclipse Persistence Services - 1.1.2.v20090612-r4475):
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-00942: Table ou vue
inexistante

Error Code: 942
Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
    bind => [50, SEQ_GEN]
Query: DataModifyQuery(sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ?
WHERE SEQ_NAME = ?")*

Maybe I forgot to set something ?
Thanks for ur help.

Re: @GeneratedValue(strategy = GenerationType.AUTO)

by Quintin Beukes-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have had some struggles with Toplink (now Eclipselink) and sequence
generators as well, so I might be able to help with that.

Few questions.
1. Does the table "sequence" actually exist in your database?
2. What is your default schema, if any?
3. What is your "eclipselink.ddl-generation" mode. If it is
create-tables, try drop-and-create-tables. If this doesn't help, try
setting "eclipselink.ddl-generation.output-mode=both" in your
persistence unit properties and paste the output of the generated sql
script.
4. Could you perhaps translate "Table ou vue inexistante". I figure it
says something about or the table doesn't exist, but it might point
out more as to what is going wrong.

Quintin Beukes



On Wed, Oct 21, 2009 at 7:40 PM, El Arbi Aboussoror
<aboussoror@...> wrote:

> Hello,
> When I try to store one of my entities that uses the annotation
> @GeneratedValue(strategy = GenerationType.AUTO) on the "id" field I get this
> error:
>
> *[EL Info]: 2009-10-21 18:47:35.337--ServerSession(6451154)--EclipseLink,
> version: Eclipse Persistence Services - 1.1.2.v20090612-r4475
> [EL Info]: 2009-10-21
> 18:47:35.976--ServerSession(6451154)--file:/G:/data/eclipse/workspace_0/Educa-EJB/build/classes/-educaPU
> login successful
> [EL Warning]: 2009-10-21 18:47:36.054--ClientSession(2003839)--Exception
> [EclipseLink-4002] (Eclipse Persistence Services - 1.1.2.v20090612-r4475):
> org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: java.sql.SQLException: ORA-00942: Table ou vue
> inexistante
>
> Error Code: 942
> Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
>    bind => [50, SEQ_GEN]
> Query: DataModifyQuery(sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ?
> WHERE SEQ_NAME = ?")*
>
> Maybe I forgot to set something ?
> Thanks for ur help.
>

Re: @GeneratedValue(strategy = GenerationType.AUTO)

by hypnosat7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

1) No, I think that Oracle created to generate to ids automatically.
2) I'm working with Oracle XE, my default schema is SYSTEM.
3) My persistence.xml doesn't contain an eclipselink.ddl-generation property.
This is the configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
        <persistence-unit name="educaPU">
                <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
                <jta-data-source>java:/OracleDS</jta-data-source>
                <properties>
                        <property name="hibernate.hbm2ddl.auto" value="drop-create" />
                        <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
                        <!-- MySQL
                        <property name="hibernate.hbm2ddl.auto" value="create-drop" />
                        <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect" />
                        -->
                </properties>
        </persistence-unit>
</persistence>

4) Table or view doesn't exist

Quintin Beukes-2 wrote:
I have had some struggles with Toplink (now Eclipselink) and sequence
generators as well, so I might be able to help with that.

Few questions.
1. Does the table "sequence" actually exist in your database?
2. What is your default schema, if any?
3. What is your "eclipselink.ddl-generation" mode. If it is
create-tables, try drop-and-create-tables. If this doesn't help, try
setting "eclipselink.ddl-generation.output-mode=both" in your
persistence unit properties and paste the output of the generated sql
script.
4. Could you perhaps translate "Table ou vue inexistante". I figure it
says something about or the table doesn't exist, but it might point
out more as to what is going wrong.

Quintin Beukes



On Wed, Oct 21, 2009 at 7:40 PM, El Arbi Aboussoror
<aboussoror@gmail.com> wrote:
> Hello,
> When I try to store one of my entities that uses the annotation
> @GeneratedValue(strategy = GenerationType.AUTO) on the "id" field I get this
> error:
>
> *[EL Info]: 2009-10-21 18:47:35.337--ServerSession(6451154)--EclipseLink,
> version: Eclipse Persistence Services - 1.1.2.v20090612-r4475
> [EL Info]: 2009-10-21
> 18:47:35.976--ServerSession(6451154)--file:/G:/data/eclipse/workspace_0/Educa-EJB/build/classes/-educaPU
> login successful
> [EL Warning]: 2009-10-21 18:47:36.054--ClientSession(2003839)--Exception
> [EclipseLink-4002] (Eclipse Persistence Services - 1.1.2.v20090612-r4475):
> org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: java.sql.SQLException: ORA-00942: Table ou vue
> inexistante
>
> Error Code: 942
> Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
>    bind => [50, SEQ_GEN]
> Query: DataModifyQuery(sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ?
> WHERE SEQ_NAME = ?")*
>
> Maybe I forgot to set something ?
> Thanks for ur help.
>

RE: @GeneratedValue(strategy = GenerationType.AUTO)

by meetoblivion :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well this is likely your issue

<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
                <jta-data-source>java:/OracleDS</jta-data-source>
                <properties>
                        <property name="hibernate.hbm2ddl.auto" value="drop-create" />
                        <property name="hibernate.dialect"
value="org.hibernate.dialect.Oracle10gDialect" />

if you're using the eclipse persistence provider (EclipseLink) you can't use hibernate properties.  Either we need to switch to hibernate as your persistence provider or you should change your properties to be eclipse link.

-----Original Message-----
From: hypnosat7 [mailto:ablarbi@...]
Sent: Wednesday, October 21, 2009 3:52 PM
To: users@...
Subject: Re: @GeneratedValue(strategy = GenerationType.AUTO)


1) No, I think that Oracle created to generate to ids automatically.
2) I'm working with Oracle XE, my default schema is SYSTEM.
3) My persistence.xml doesn't contain an eclipselink.ddl-generation
property.
This is the configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
        <persistence-unit name="educaPU">
                <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
                <jta-data-source>java:/OracleDS</jta-data-source>
                <properties>
                        <property name="hibernate.hbm2ddl.auto" value="drop-create" />
                        <property name="hibernate.dialect"
value="org.hibernate.dialect.Oracle10gDialect" />
                        <!-- MySQL
                        <property name="hibernate.hbm2ddl.auto" value="create-drop" />
                        <property name="hibernate.dialect"
value="org.hibernate.dialect.MySQLInnoDBDialect" />
                        -->
                </properties>
        </persistence-unit>
</persistence>

4) Table or view doesn't exist


Quintin Beukes-2 wrote:

>
> I have had some struggles with Toplink (now Eclipselink) and sequence
> generators as well, so I might be able to help with that.
>
> Few questions.
> 1. Does the table "sequence" actually exist in your database?
> 2. What is your default schema, if any?
> 3. What is your "eclipselink.ddl-generation" mode. If it is
> create-tables, try drop-and-create-tables. If this doesn't help, try
> setting "eclipselink.ddl-generation.output-mode=both" in your
> persistence unit properties and paste the output of the generated sql
> script.
> 4. Could you perhaps translate "Table ou vue inexistante". I figure it
> says something about or the table doesn't exist, but it might point
> out more as to what is going wrong.
>
> Quintin Beukes
>
>
>
> On Wed, Oct 21, 2009 at 7:40 PM, El Arbi Aboussoror
> <aboussoror@...> wrote:
>> Hello,
>> When I try to store one of my entities that uses the annotation
>> @GeneratedValue(strategy = GenerationType.AUTO) on the "id" field I get
>> this
>> error:
>>
>> *[EL Info]: 2009-10-21 18:47:35.337--ServerSession(6451154)--EclipseLink,
>> version: Eclipse Persistence Services - 1.1.2.v20090612-r4475
>> [EL Info]: 2009-10-21
>> 18:47:35.976--ServerSession(6451154)--file:/G:/data/eclipse/workspace_0/Educa-EJB/build/classes/-educaPU
>> login successful
>> [EL Warning]: 2009-10-21 18:47:36.054--ClientSession(2003839)--Exception
>> [EclipseLink-4002] (Eclipse Persistence Services -
>> 1.1.2.v20090612-r4475):
>> org.eclipse.persistence.exceptions.DatabaseException
>> Internal Exception: java.sql.SQLException: ORA-00942: Table ou vue
>> inexistante
>>
>> Error Code: 942
>> Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
>>    bind => [50, SEQ_GEN]
>> Query: DataModifyQuery(sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ?
>> WHERE SEQ_NAME = ?")*
>>
>> Maybe I forgot to set something ?
>> Thanks for ur help.
>>
>
>

--
View this message in context: http://www.nabble.com/%40GeneratedValue%28strategy-%3D-GenerationType.AUTO%29-tp25997753p25999110.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.423 / Virus Database: 270.14.24/2449 - Release Date: 10/21/09 16:44:00


Re: @GeneratedValue(strategy = GenerationType.AUTO)

by Quintin Beukes-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> if you're using the eclipse persistence provider (EclipseLink) you can't use hibernate properties.  Either we need to switch to hibernate as your persistence provider or you should change your properties to be eclipse link.

Well spotted :>

Have a look at http://is.gd/4votQ for which properties to use to
generate schemas with EclipseLink. Or like mentioned, switch your
provider to Hibernate. If you're doing this, which application server
are you using? It's a bit tricky to get the same configuration running
for Embedded OpenEJB and an application server when using Hibernate.

Q

RE: @GeneratedValue(strategy = GenerationType.AUTO)

by hypnosat7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks!
But meanwhile I've switched to another strategie for testing. I'll use HSQL.
meetoblivion wrote:
Well this is likely your issue

<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
                <jta-data-source>java:/OracleDS</jta-data-source>
                <properties>
                        <property name="hibernate.hbm2ddl.auto" value="drop-create" />
                        <property name="hibernate.dialect"
value="org.hibernate.dialect.Oracle10gDialect" />

if you're using the eclipse persistence provider (EclipseLink) you can't use hibernate properties.  Either we need to switch to hibernate as your persistence provider or you should change your properties to be eclipse link.

-----Original Message-----
From: hypnosat7 [mailto:ablarbi@yahoo.fr]
Sent: Wednesday, October 21, 2009 3:52 PM
To: users@openejb.apache.org
Subject: Re: @GeneratedValue(strategy = GenerationType.AUTO)


1) No, I think that Oracle created to generate to ids automatically.
2) I'm working with Oracle XE, my default schema is SYSTEM.
3) My persistence.xml doesn't contain an eclipselink.ddl-generation
property.
This is the configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
        <persistence-unit name="educaPU">
                <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
                <jta-data-source>java:/OracleDS</jta-data-source>
                <properties>
                        <property name="hibernate.hbm2ddl.auto" value="drop-create" />
                        <property name="hibernate.dialect"
value="org.hibernate.dialect.Oracle10gDialect" />
                        <!-- MySQL
                        <property name="hibernate.hbm2ddl.auto" value="create-drop" />
                        <property name="hibernate.dialect"
value="org.hibernate.dialect.MySQLInnoDBDialect" />
                        -->
                </properties>
        </persistence-unit>
</persistence>

4) Table or view doesn't exist


Quintin Beukes-2 wrote:
>
> I have had some struggles with Toplink (now Eclipselink) and sequence
> generators as well, so I might be able to help with that.
>
> Few questions.
> 1. Does the table "sequence" actually exist in your database?
> 2. What is your default schema, if any?
> 3. What is your "eclipselink.ddl-generation" mode. If it is
> create-tables, try drop-and-create-tables. If this doesn't help, try
> setting "eclipselink.ddl-generation.output-mode=both" in your
> persistence unit properties and paste the output of the generated sql
> script.
> 4. Could you perhaps translate "Table ou vue inexistante". I figure it
> says something about or the table doesn't exist, but it might point
> out more as to what is going wrong.
>
> Quintin Beukes
>
>
>
> On Wed, Oct 21, 2009 at 7:40 PM, El Arbi Aboussoror
> <aboussoror@gmail.com> wrote:
>> Hello,
>> When I try to store one of my entities that uses the annotation
>> @GeneratedValue(strategy = GenerationType.AUTO) on the "id" field I get
>> this
>> error:
>>
>> *[EL Info]: 2009-10-21 18:47:35.337--ServerSession(6451154)--EclipseLink,
>> version: Eclipse Persistence Services - 1.1.2.v20090612-r4475
>> [EL Info]: 2009-10-21
>> 18:47:35.976--ServerSession(6451154)--file:/G:/data/eclipse/workspace_0/Educa-EJB/build/classes/-educaPU
>> login successful
>> [EL Warning]: 2009-10-21 18:47:36.054--ClientSession(2003839)--Exception
>> [EclipseLink-4002] (Eclipse Persistence Services -
>> 1.1.2.v20090612-r4475):
>> org.eclipse.persistence.exceptions.DatabaseException
>> Internal Exception: java.sql.SQLException: ORA-00942: Table ou vue
>> inexistante
>>
>> Error Code: 942
>> Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
>>    bind => [50, SEQ_GEN]
>> Query: DataModifyQuery(sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ?
>> WHERE SEQ_NAME = ?")*
>>
>> Maybe I forgot to set something ?
>> Thanks for ur help.
>>
>
>

--
View this message in context: http://www.nabble.com/%40GeneratedValue%28strategy-%3D-GenerationType.AUTO%29-tp25997753p25999110.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.423 / Virus Database: 270.14.24/2449 - Release Date: 10/21/09 16:44:00