Auto increment a field ?

We use project number for our productions. I'd like to create a new project number for each new production that is the max(project number)+1. I guess I will have to update the database. How would I do that ?
I managed to get the max(project number) SQL command :
/Library/Application\ Support/Final\ Cut\ Server/Final\ Cut\ Server.bundle/Contents/Resources/sbin/fcsvr_run psql px pxdb -c "SELECT max(pxmdvalue.value) FROM pxentity inner join pxmdvalue on pxmdvalue.entityid = pxentity.entityid WHERE pxentity .parententityid = (SELECT entityid from pxentity where address = '/project') and (pxmdvalue.fieldid=(select fieldid from pxmdfield where name='Project Number' and mdgroupcategoryid='100'));"
it works. but I need the command to update this field to +1. Anyone ?
Thanks a lot
Fred

Hi Debasis,
Have a look on this
Quick note on IDENTITY column in SAP HANA
Regards,
Krishna Tangudu

Similar Messages

  • Utilizing auto-increment/identity fields for primary key with "application" identity

    Is it possible to utilise an auto-increment (identity in MS SQL Server)
    field for the primary key field when using "application" identity?

    To the best of my knowledge, you cannot use auto-increment. Due to the
    differences in the way that identities are generated at the datastore
    (upon insert) vs. JDO (upon makePersistent), this feature of SQLServer is
    not supported yet.
    However, we do provide a variety of other ways of generating identity
    which may provide a closer fit to what you want, and
    our users may have some experience in solving your problem.
    On Tue, 28 Jan 2003 09:56:08 +0000, Sean Ryan wrote:
    Is it possible to utilise an auto-increment (identity in MS SQL Server)
    field for the primary key field when using "application" identity?--
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • Auto Increment ID Field Table in the Oracle Database (insert new record)

    I have been using the MySQL. And the ID field of the database table is AUTO INCREMENT. When I insert a new record into a database table, I can have a statement like:
       public void createThread( String receiver, String sender, String title,
                                 String lastPostMemberName, String threadTopic,
                                 String threadBody, Timestamp threadCreationDate,
                                 Timestamp threadLastPostDate, int threadType,
                                 int threadOption, int threadStatus, int threadViewCount,
                                 int threadReplyCount, int threadDuration )
                                 throws MessageDAOSysExceptionand I do not have to put the ID variable in the above method. The table will give the new record an ID number that is equivalent to the ID number of the last record plus one automatically.
    Now, I am inserting a new record into an Oracle database table. I am told that I cannot do what I am used to doing with the MySQL database.
    How do I revise the createThread method while I have no idea about what the next sequence number shall be?

    I am still very confused; in particular, the Java part. Let me try again.
    // This part is for the database table creation
    -- Component primary key sequence
    CREATE SEQUENCE dhsinfo_page_content_seq
        START WITH 0;
    -- Trigger for updating the Component primary key
    CREATE OR REPLACE TRIGGER DHSInfoPageContent_INSERT_TRIGGER
        BEFORE INSERT ON DHSInfoPageContent //DHSInfoPageContent is the table name
        FOR EACH ROW WHEN (new.ID IS NULL) // ID is the column name for auto increment
        BEGIN
            SELECT dhsinfo_page_content_seq.Nextval
            INTO :ID
            FROM DUAL;
        END;/I am uncertain what to do with my Java code. (I have been working with the MySQL. Changing to the Oracle makes me very confused.
       public void updateContent( int groupID, String pageName, int componentID,
                                  String content, Timestamp contentCreationDate )
                                   throws contentDAOSysException
       // The above Java statement does not have a value to insert into the ID column
       // in the DHSInfoPageContent table
          Connection conn = null;
          PreparedStatement stmt = null;
          // what to do with the INSERT INTO below.  Note the paramether ID.
          String insertSQL = "INSERT INTO DHSInfoPageContent( ID, GroupID, Name, ComponentID, Content, CreationDate ) VALUES (?, ?, ?, ?, ?, ?)";
          try
             conn = DBConnection.getDBConnection();
             stmt = conn.prepareStatement( insertSQL );
             stmt.setInt( 1, id ); // Is this Java statement redundant?
             stmt.setInt( 2, groupID );
             stmt.setString( 3, pageName );
             stmt.setInt( 4, componentID );
             stmt.setString( 5, content );
             stmt.setTimestamp( 6, contentCreationDate );
             stmt.executeUpdate();
           catch
           finally

  • Auto increment number field

    Hello,
    I would like to have a number field to be auto increment. Ho can I do that in Oracle must I use some code for it or can I make the field auto increment by itself.
    Thanks

    user3311314 wrote:
    Hello,
    I would like to have a number field to be auto increment. Ho can I do that in Oracle must I use some code for it or can I make the field auto increment by itself.
    ThanksIt's a long standing gripe of mine. You must use code, and the appropriate solution is a sequence and a trigger, eg
    SASH_CLIENT @ DB10G >create table t(
      2      id number not null primary key
      3  ,   c1 char(100));
    Table created.
    SASH_CLIENT @ DB10G >
    SASH_CLIENT @ DB10G >create sequence seq_t;
    Sequence created
    SASH_CLIENT @ DB10G >
    SASH_CLIENT @ DB10G >create or replace trigger bir_t
      2  before insert on t
      3  for each row
      4  begin
      5  select seq_t.nextval into :new.id from dual;
      6  end;
      7  /
    Trigger created.
    SASH_CLIENT @ DB10G >insert into t(c1) values ('row 1');
    1 row created.
    SASH_CLIENT @ DB10G >commit;
    Commit complete.
    SASH_CLIENT @ DB10G >select * from t;
            ID C1
             1 row 1I'd much prefer
    create table t (
       id number primary key default seq_t.nextval
    ,  c1 char(100));

  • Auto Incrementing a field in a database table

    Hello All,
    I have created a database table for generating a unique ID, based on two key fields; Product and Area.
    For a particular Product and Area,the ID generated should be unique, and it will be the third field of my table.
    Is there any possible way by which i can generate the ID automatically,based on the Product And Area entered? The ID should also be automatically incremented based on the next entry.
    Can anyone help me in resolving this problem?
    Also, if i am deleting a particular Product and Area, will it be possible to remove the ID generated by it?
    Thanks In Advance.
    Shino.

    Hi,
    If you are using a generated maintenance screen and populating the data manually your approach will need to be different.
    It could be possible to use a user exit in the generated screen to populate your ID field, but you will face the risk that the user will be able to presumably over-type the ID or enter their own value.
    Consider your overall requirement and design, it may be that a generated maintenance sceen is not the most suitable way to build this functionality.
    Regards,
    Nick

  • How can I create an auto-incrementing ID field for a web app?

    I have a web app for a project database. Customers can login and add a new record to the web app. We need it to provide each new project with a unique and sequential number. The BC ID number for each web app item is unique but of course not sequential (and too long). So for example the client would like all project IDs to be 4 digits starting from 1000. Any ideas?
    Thanks in advance!

    Kapowaz,
    Just thinking out loud, I wonder if you could use an Automator action to find the last invoice created and open a new file with a name based on incrementing a part of last file's filename. This would make the filename the same as the invoice number and you would still have to transfer the file's name to the content of the file.
    If I had this need, I think I would create an Invoice Log document. It would be easy to have a table into which you would enter identifying data and date and have the table generate a new invoice number that you could paste into the current invoice document. It would kill two birds with one stone if you need an index of your invoices.
    Jerry

  • Auto-Incrementing Date Field

    In my report I have information on parts that have been ordered.  I have the part number, date ordered, quantity ordered, date received, among others.  What I want to do is insert a custom field that gives me each day that had transpired beteen the Date Ordered and the Date Received.  I want one row for each intervening date, including the Date Ordered and the Date Received.  How can I do that?

    Hi,
    I am not sure if you can get a dates between ordered date and received date. However you can get it as a comma separated list as a field.
    Try following formula
    numberVar d:= DateDiff ("d",{ABC.DT_ORD},{ABC.DT_RECEIVED} );
    numberVar i;
    StringVar abc;
    StringVar inDate;
    for i:=1 to d do
    abc:=totext({ABC.DT_ORD} + d);
    inDate:=inDate & abc & ",";
    inDate;
    --Kuldeep

  • Auto Increment Not Working - SQL Identity field

    I am new to Visual Basic & SQL server but have some experience in Access & VBA. But this is a steep learning curve!
    I am banging my head against a wall with a problem..
    All of my tables in this database are in the dataset. The main one being tblItems with a PK 'ITEMID'
    I have 2 forms - the first one is used to lookup an item the second displays the item's full details.
    On the first form (lookup) I have a 'Add New' button which launches the second form with the code - frmProductDetail.VItemsBindingSource.AddNew()
    This opens the form with empty boxes as expected. I have a 'Save' button on the second form with the following code -
            Dim row As SASHItemsDataSet.tblItemsRow
            row = SASHItemsDataSet.tblItems.NewRow
            With row
                .ITEMCODE = txtItemCode.Text
                .ITEMDESCRIPTION = txtItemDescription.Text
                .CATEGORY = cmbItemCategory.SelectedValue
                .PURCHCOST = txtPurchCost.Text
                .SELLCOST = txtSellPrice.Text
                .UNIT = cmbUOM.SelectedValue
                .VATID = cmbVAT.SelectedValue
                .WHLOCATION = cmbWHLoc.SelectedValue
            End With
            SASHItemsDataSet.tblItems.Rows.Add()
            Try
                Me.Validate()
                Me.VItemsBindingSource.EndEdit()
            Catch ex As Exception
                MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "UPDATE FAILED")
            End Try
    My problem is I get the error msg box with the following error 'Column 'ITEMID' does not allow nulls'
    This field is set as a auto incrementing identity field with all the correct settings shown in Visual Studio so it shouldn't be coming back as null.
    I have Googled for hours & tried all sorts with no luck..
    I have clearly gone wrong somewhere but I can't work out where... any help appreciated!
    James

    This is the code on frmProductLookup that opens the form...
            frmProductDetail.Show()
            frmProductDetail.VItemsBindingSource.AddNew()
    This is the code on frmProductDetail_Load...
            'TODO: This line of code loads data into the 'SASHItemsDataSet.tblVAT' table. You can move, or remove it, as needed.
            Me.TblVATTableAdapter.Fill(Me.SASHItemsDataSet.tblVAT)
            'TODO: This line of code loads data into the 'SASHItemsDataSet.tblWarehouseLocations' table. You can move, or remove it, as needed.
            Me.TblWarehouseLocationsTableAdapter.Fill(Me.SASHItemsDataSet.tblWarehouseLocations)
            'TODO: This line of code loads data into the 'SASHItemsDataSet.tblStockUnits' table. You can move, or remove it, as needed.
            Me.TblStockUnitsTableAdapter.Fill(Me.SASHItemsDataSet.tblStockUnits)
            'TODO: This line of code loads data into the 'SASHItemsDataSet.tblItemCategory' table. You can move, or remove it, as needed.
            Me.TblItemCategoryTableAdapter.Fill(Me.SASHItemsDataSet.tblItemCategory)
            'TODO: This line of code loads data into the 'SASHItemsDataSet.vItems' table. You can move, or remove it, as needed.
            'Me.VItemsTableAdapter.Fill(Me.SASHItemsDataSet.vItems)
            Me.VItemsTableAdapter.Fill(Me.SASHItemsDataSet.vItems)
            Me.VItemsBindingSource.Position = Me.VItemsBindingSource.Find("ITEMID", _passedText)
            Me.txtWKSName.Text = Environment.MachineName
            Me.txtSellPrice.Text = FormatCurrency(Me.txtSellPrice.Text)
            Me.txtPurchCost.Text = FormatCurrency(Me.txtPurchCost.Text)
            Me.txtPriceIVAT.Text = FormatCurrency(Me.txtSellPrice.Text + (Me.txtSellPrice.Text * 0.2))
    On the tblItemTableAdapter this is the Command Text for the Insert Command...
    INSERT INTO tblItems
                             (ITEMCODE, ITEMDESCRIPTION, UNIT, WHLOCATION, VATID, PREFSUPPLIER, CATEGORY, PURCHCOST, SELLCOST, INACTIVE)
    VALUES        (@ITEMCODE,@ITEMDESCRIPTION,@UNIT,@WHLOCATION,@VATID,@PREFSUPPLIER,@CATEGORY,@PURCHCOST,@SELLCOST,@INACTIVE)
    SQL Server Management Studio clearly shows the column as an Identity column. If I add a row through SSMS it does create an PK identity automatically. I have also dropped the ITEMID column & recreated through SSMS which has no effect.
    I am now considering creating a separate form just for adding an item but I have managed it in Access but am just struggling with VB!
    Thanks,
    James

  • Gets the new id of auto-increment field by jdbc

    There is a auto-increment index field of a table. I would like to add a row in that table by jdbc. The process is success and the index will increase automatically. However i would like to get the newly added index number. How can i do this? Thanks a lot.

    This is off of Microsoft's T-SQL site http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_tsqlcon_6lyk.asp
    @@IDENTITY and SCOPE_IDENTITY will return the last identity value generated in any table in the current session. However, SCOPE_IDENTITY returns the value only within the current scope; @@IDENTITY is not limited to a specific scope.
    IDENT_CURRENT is not limited by scope and session; it is limited to a specified table. IDENT_CURRENT returns the identity value generated for a specific table in any session and any scope. For more information, see IDENT_CURRENT.

  • Using an DB auto-increment feature on a PK

    Hi,
    I work with an Oracle target DB and I have a trigger which auto-increment the field ID (it's my pk).
    In my interface, I map all the fields and let my ID field empty in order to let Oracle filling it.
    But when I run the interface, I have this error message at step "insert flow into $ table" :
    936 : 42000 : java.sql.SQLException : ORA-00936: expression absente
    If I change my PK, it works so I think the issue is there. Can I easily solve this ?
    Thanks

    Thanks for your answer but didn't work better.
    I solved the issue using the IK SQL Control Append in the flow tab and disabling the PK constraint in the check tab. All other options set as default.
    I don't know if it's the better solution but it works...

  • How can I automatically increment an auto incremented column?

    Hello!
    I have a table with an auto incremented "id" field.
    It looks like this:
    id (PK, auto_increment) name address phone
    I would like to make an insertion like:
    INSERT INTO Person (name, address, phone) VALUES (?,?,?)
    ...but it says that all fields have to be used.
    I get
    java.sql.SQLException: Field 'id' doesn't have a default value
    How can I bypass this?
    I have looked at [this example|http://blog.taragana.com/index.php/archive/java-how-to-get-auto-increment-values-after-sql-insert/] , but it didn´t work for me, it still says the "id" column has not a default value:

    Sorry, it is a MySQL database.
    The table consists of 4 columns:
    id (PK, auto_increment)
    name (Varchar)
    address (Varchar)
    phone (Varchar)
    If I use PHPMyAdmin to insert a new row, then this query works:
    INSERT INTO `mydb`.`person` (
    `id` ,
    `name` ,
    `address` ,
    `phone`
    VALUES (
    NULL , 'Test', 'Roxxor', 'Europe', '12345'
    );{code}I tested to use the method setNull() on the first column in the preparedStatement but it didn´t work.
    Do you need more info from me to be able to help me?
    I have tried this (but got the error that the "Field 'id' doesn't have a default value"):
    [code]con.setAutoCommit(true);
                String query = "INSERT INTO person(id, name, address, phone) VALUES (?, ?, ?, ?)";
                PreparedStatement stmt = con.prepareStatement(query);
                stmt.setNull(1, java.sql.Types.NULL);
                stmt.setString(2, name); 
                stmt.setString(3, address);     
                stmt.setString(4, phone); 
                stmt.executeUpdate(); 
                stmt.close();[/code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Insert to 2 Tables and Auto-Increment

    I applied the Insert To 2 Tables Wizard and then added an Auto-Increment
    behavior to auto increment a field in the master table. BUT - I also
    need to auto-increment a field in the detail table. The AutoIncrement
    behavior only offers fields for the master table. So - how do I
    auto-increment the detail table?
    I know I could create a custom trigger - but how do you grab the primary
    key from the DETAIL table?
    Alec Fehl, MCSE, A+, ACE, ACI
    Adobe Community Expert
    AUTHOR:
    Microsoft Office 2007 PowerPoint: Comprehensive Course (Labyrinth
    Publications)
    Welcome to Web Design and HTML (Labyrinth Publications)
    CO-AUTHOR:
    Microsoft Office 2007: Essentials (Labyrinth Publications)
    Computer Concepts and Vista (Labyrinth Publications)
    Mike Meyers' A+ Guide to Managing and Troubleshooting PCs (McGraw-Hill)
    Internet Systems and Applications (EMC Paradigm)

    Got it. Advanced tab of the AutoIncrement server behavior - remove the
    master table and add the detail table. Then return to basic tab and add
    the appropriate field.
    Alec Fehl, MCSE, A+, ACE, ACI
    Adobe Community Expert
    AUTHOR:
    Microsoft Office 2007 PowerPoint: Comprehensive Course (Labyrinth
    Publications)
    Welcome to Web Design and HTML (Labyrinth Publications)
    CO-AUTHOR:
    Microsoft Office 2007: Essentials (Labyrinth Publications)
    Computer Concepts and Vista (Labyrinth Publications)
    Mike Meyers' A+ Guide to Managing and Troubleshooting PCs (McGraw-Hill)
    Internet Systems and Applications (EMC Paradigm)

  • Auto Increment of Primary Field in Table Maintainance

    Hi,
    We want to give an Auto increment to the Primary Key, when ever the table is updated/inserted with a new record. How to get the value updated????
    For Eg,
    Table ZTEST Contains     MANDT, ITEM,   EBELN.
    It should have the values 800    001   000977
    And when the next record is created, the ITEM value should be Automatically get the value 002.. and so on for every Record.
    Pls do let me know if any other details is reqd.
    Thanx in Advance.
    Ajaz

    Dear Syed,
       You can do many things in table maintenance screen like validation of some field, making some field required or displayed etc.
       For auto increment you have to use Number-Ranges. FM NUMBER_GET_NEXT is helpful in this case.
       Where to write the code??? The Function-Group you have made. There will be includes. You can easily locate the place to write these codes.
       Caution point is that if you re-generate the table maintenance then all code will be gone.
    Regards,
    Deva.

  • Auto Incrementing in Text Field

    I imported a tab file and one column was the city, state and zip code. For some reason, the Zip code auto increments. It just so happened that the first cell was Durham, NC 27701. All subsequent cells incremented the Zip code by one, so the second cell became Durham, NC 27702. I have tried making the column a text field, and that did not work. I do not find any formula in the field, so am at a loss as to how to prevent the auto-incrementing from hapening.

    rha3675 wrote:
    Which Vallauris is your home city? Provence, or Pyrenees?
    None, Vallauris is not in Provence but in 'Provence-Alpes-Côte-d'Azur'
    At this time there is a great discussion about this name.
    Some wish to change it because they think that thge acronym PACA is not their cup of tea.
    Given that, inhabitants of "Provence" refuse to drop "Provence",
    inhabitants of "Alpes" refuse to drop "Alpes",
    inhabitants of "Cote d'Azur" refuse to drop "Cote d'Azur".
    My own advice is simply : don't use an acronym !
    I searched heavily and din't find a Vallauris in Pyrénées.
    The only town whose name approach is :
    I just found :
    Valaurie
    Code postal: 26230
    Département: Drôme
    Région: Rhône-Alpes
    Vallauris sits between Cannes and Antibes.
    Yvan KOENIG (VALLAURIS, France) mardi 2 février 2010 17:45:21

  • Integer auto-increment fields

    I am using 3.0.3 and have a PC class that uses application identity and
    MSSQL server, so we are using auto-increment fields for our primary keys.
    In the past (with sequence-generated ids) we have used Integers for our
    mapped attributes, but with the application identity, it seems we need to
    use ints. Is there a reason for this, or is it a bug?
    Nathan

    Great. Thanks for the help.
    Nathan
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Nathan-
    This is a bug. I've reported it at:
    http://bugzilla.solarmetric.com/show_bug.cgi?id=910
    I expect it will be fixed in the next release. In the meantime, if you
    want to use a numeric wrapper for your auto-increment field, it will
    need to be of type java.lang.Long.
    In article <[email protected]>, Nathan Voxland wrote:
    It does work with Longs. I could switch my code to use Longs, although
    I
    don't always need that large of an id field.
    Nathan
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Nathan-
    If you change them both from Integer to a Long field, then does it
    work?
    >>>
    >>>
    In article <[email protected]>, Nathan Voxland wrote:
    Here is the code for the class and the ApplicationId class. The
    ApplicationId class was generated using the appidtool.
    public class Portfolio {
    private Integer id;
    private String name;
    private String notes;
    private Organization client;
    private Portfolio parentPortfolio;
    private Set subPortfolios;
    private Set projects;
    private Date created;
    private Person createdBy;
    private Date lastModified;
    private Person lastModifiedBy;
    public Portfolio(PersistenceManager pm) {
    pm.makePersistent(this);
    this.subPortfolios = new HashSet();
    this.projects = new HashSet();
    this.created = new Date();
    this.createdBy = new PersonPeer(pm).findLoggedIn();
    this.lastModified = this.created;
    this.lastModifiedBy = this.createdBy;
    public Integer getId() {
    return new id;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    public void jdoPostLoad() {
    public void jdoPreStore() {
    if (!((PersistenceCapable) this).jdoIsNew()) {
    this.lastModified = new Date();
    this.lastModifiedBy = new
    PersonPeer(((PersistenceCapable)
    this).jdoGetPersistenceManager()).findLoggedIn();
    public void jdoPreClear() {
    public void jdoPreDelete() {
    * Auto-generated by:
    * kodo.enhance.ApplicationIdTool
    public class PortfolioId
    implements Serializable
    static
    // register persistent class in JVM
    Class c = Portfolio.class;
    public Integer id;
    public PortfolioId ()
    public PortfolioId (String fromString)
    if ("null".equals (fromString))
    id = null;
    else
    id = new Integer (fromString);
    public String toString ()
    return String.valueOf (id);
    public int hashCode ()
    return ((id == null) ? 0 : id.hashCode ());
    public boolean equals (Object obj)
    if (this == obj)
    return true;
    if (!(obj instanceof PortfolioId))
    return false;
    PortfolioId other = (PortfolioId) obj;
    return ((id == null && other.id == null)
    || (id != null && id.equals (other.id)));
    Nathan
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Nathan-
    Is the primary key field an Integer in both the application
    identity
    class and the persistent class itself? They need to both be the same
    class.
    If they are the same, and you are still getting the exception, could
    you post the code for the classes (or else mail them to
    [email protected])?
    In article <[email protected]>, Nathan Voxland
    wrote:
    When I have my object use an int id, my test runs fine, when Iswitch
    to
    an
    Integer, I get the exception:
    kodo.util.FatalException: java.lang.ClassCastException
    NestedThrowables:
    java.lang.ClassCastException
    at
    kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:563)
    at
    com.correlat.intranet.projectmanagement.PortfolioTest.testFlush(PortfolioTes
    t.java:393)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(UnknownSource)
    at
    com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(Unknown
    Source)
    at
    com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(Unknown
    Source)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(UnknownSource)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.application.AppMain.main(UnknownSource)
    Caused by: java.lang.ClassCastException
    at
    com.correlat.intranet.projectmanagement.Portfolio.jdoReplaceField(Portfolio.
    java)
    atkodo.runtime.StateManagerImpl.replaceField(StateManagerImpl.java:2771)
    at
    kodo.runtime.StateManagerImpl.storeObjectField(StateManagerImpl.java:2272)
    atkodo.runtime.StateManagerImpl.storeObject(StateManagerImpl.java:2252)
    at
    kodo.jdbc.meta.ValueFieldMapping.setAutoIncrementValue(ValueFieldMapping.jav
    a:346)
    atkodo.jdbc.meta.ClassMapping.setAutoIncrementValue(ClassMapping.java:381)
    at
    kodo.jdbc.runtime.PreparedStatementManager.flush(PreparedStatementManager.ja
    va:137)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:357)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:153)
    at
    kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:72)
    atkodo.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:507)
    at
    kodo.runtime.DelegatingStoreManager.flush(DelegatingStoreManager.java:158)
    at
    kodo.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:412)
    at
    kodo.runtime.PersistenceManagerImpl.flushInternal(PersistenceManagerImpl.jav
    a:794)
    at
    kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:550)
    ... 24 more
    NestedThrowablesStackTrace:
    java.lang.ClassCastException
    at
    com.correlat.intranet.projectmanagement.Portfolio.jdoReplaceField(Portfolio.
    java)
    atkodo.runtime.StateManagerImpl.replaceField(StateManagerImpl.java:2771)
    at
    kodo.runtime.StateManagerImpl.storeObjectField(StateManagerImpl.java:2272)
    atkodo.runtime.StateManagerImpl.storeObject(StateManagerImpl.java:2252)
    at
    kodo.jdbc.meta.ValueFieldMapping.setAutoIncrementValue(ValueFieldMapping.jav
    a:346)
    atkodo.jdbc.meta.ClassMapping.setAutoIncrementValue(ClassMapping.java:381)
    at
    kodo.jdbc.runtime.PreparedStatementManager.flush(PreparedStatementManager.ja
    va:137)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:357)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:153)
    at
    kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:72)
    atkodo.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:507)
    at
    kodo.runtime.DelegatingStoreManager.flush(DelegatingStoreManager.java:158)
    at
    kodo.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:412)
    at
    kodo.runtime.PersistenceManagerImpl.flushInternal(PersistenceManagerImpl.jav
    a:794)
    at
    kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:550)
    at
    com.correlat.intranet.projectmanagement.PortfolioTest.testFlush(PortfolioTes
    t.java:393)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(UnknownSource)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.application.AppMain.main(UnknownSource)
    Nathan
    "Patrick Linskey" <[email protected]> wrote in message
    news:[email protected]...
    What behavior are you seeing that is preventing you from using
    Integers?
    -Patrick
    Nathan Voxland wrote:
    I am using 3.0.3 and have a PC class that uses application
    identity
    and
    MSSQL server, so we are using auto-increment fields for our
    primary
    keys.
    In the past (with sequence-generated ids) we have used Integers
    for
    our
    mapped attributes, but with the application identity, it seems
    we
    need
    to
    use ints. Is there a reason for this, or is it a bug?
    Nathan
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

Maybe you are looking for