This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 85530 - Generate and support serialVersionUID
Summary: Generate and support serialVersionUID
Status: RESOLVED DUPLICATE of bug 70746
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@javaee
URL:
Keywords:
: 114867 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-22 08:31 UTC by Andrei Badea
Modified: 2008-01-15 14:37 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2006-09-22 08:31:01 UTC
When a Serializabe entity class is generated it should contain a 

    private static final long serialVersionUID = 1L;

and there should also be a hint offering to create it if it doesn't exist. The
hint should be probably provided by the Java infrastructure, not by the
j2ee/verification module.

See also issue 79556.
Comment 1 Erno Mononen 2007-02-15 14:49:24 UTC
Implemented the generation part for the New Entity Wizard. Needs to be 
implemented also for the ECs from DB wizard (I'll do that) and then the support 
part needs to done as well. Tomasz, could you have a look at the latter? I'll 
pass you this issue once the generation part is fully implemented. 

Checking in EntityWizard.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/wizard/entity/
EntityWizard.java,v  <--  EntityWizard.java
new revision: 1.15; previous revision: 1.14
done 
Comment 2 Erno Mononen 2007-09-06 12:20:10 UTC
*** Issue 114867 has been marked as a duplicate of this issue. ***
Comment 3 alanbur 2007-09-10 16:39:43 UTC
In fact there should be an option which allows you to specify if an entity class implements Serializable at all -
Serializable isn't necessary for JPA entity classes.
Comment 4 Erno Mononen 2007-09-12 14:31:42 UTC
I added the generation of the field to the Entities from DB wizard. I reopened issue 79556, we'll have to see whether 
it will be accepted. If not, Tomasz, could you have a look whether implementing the hint in j2ee/verification would 
make sense? 

Making the generation of the field (and implementing Serializable) optional needs to be handled in a separate issue.

Checking in src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/JavaPersistenceGenerator.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/JavaPersistenceGenerator.java,v  <--  
JavaPersistenceGenerator.java
new revision: 1.22; previous revision: 1.21
done
Checking in test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/JavaPersistenceGeneratorTest/
testGenerateTwoUnrelated/User.pass;
/cvs/j2ee/persistence/test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/
JavaPersistenceGeneratorTest/testGenerateTwoUnrelated/User.pass,v  <--  User.pass
new revision: 1.8; previous revision: 1.7
done
Checking in test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/JavaPersistenceGeneratorTest/
testGenerateTwoUnrelated/Product.pass;
/cvs/j2ee/persistence/test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/
JavaPersistenceGeneratorTest/testGenerateTwoUnrelated/Product.pass,v  <--  Product.pass
new revision: 1.8; previous revision: 1.7
done
Checking in test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/JavaPersistenceGeneratorTest/
testGenerateOneEntity/User.pass;
/cvs/j2ee/persistence/test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/
JavaPersistenceGeneratorTest/testGenerateOneEntity/User.pass,v  <--  User.pass
new revision: 1.6; previous revision: 1.5
done
Checking in test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/JavaPersistenceGeneratorTest/
testGenerateEntityFromSampleSchema/Customer.pass;
/cvs/j2ee/persistence/test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/
JavaPersistenceGeneratorTest/testGenerateEntityFromSampleSchema/Customer.pass,v  <--  Customer.pass
new revision: 1.6; previous revision: 1.5
done
Checking in test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/JavaPersistenceGeneratorTest/
testGenerateRelatedEntitiesFromSampleSchema/ProductCode.pass;
/cvs/j2ee/persistence/test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/
JavaPersistenceGeneratorTest/testGenerateRelatedEntitiesFromSampleSchema/ProductCode.pass,v  <--  ProductCode.pass
new revision: 1.6; previous revision: 1.5
done
Checking in test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/JavaPersistenceGeneratorTest/
testGenerateRelatedEntitiesFromSampleSchema/Product.pass;
/cvs/j2ee/persistence/test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/
JavaPersistenceGeneratorTest/testGenerateRelatedEntitiesFromSampleSchema/Product.pass,v  <--  Product.pass
new revision: 1.6; previous revision: 1.5
done
Checking in test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/JavaPersistenceGeneratorTest/
testGenerateRelatedEntitiesFromSampleSchema/Manufacturer.pass;
/cvs/j2ee/persistence/test/unit/data/goldenfiles/org/netbeans/modules/j2ee/persistence/wizard/fromdb/
JavaPersistenceGeneratorTest/testGenerateRelatedEntitiesFromSampleSchema/Manufacturer.pass,v  <--  Manufacturer.pass
new revision: 1.6; previous revision: 1.5
done
Comment 5 Erno Mononen 2007-10-31 12:07:23 UTC
Taking over.
Comment 6 _ gtzabari 2008-01-08 21:16:40 UTC
*** Issue 118255 has been marked as a duplicate of this issue. ***
Comment 7 fommil 2008-01-09 23:30:00 UTC
isn't this a dupe of issue 70746?
Comment 8 Andrei Badea 2008-01-15 14:37:55 UTC
fommil: yes, it is, thanks.


*** This issue has been marked as a duplicate of 70746 ***