marten kay wrote:Thanks Jeanne,
There's one piece of technology I forgot to list. Is Netbeans still a solid IDE? I liked it, or have others over taken it?
R L Miller wrote:@Campbell Ritchie
Honestly, I don't know what I wanted. I am in an online Java course ( my first Java) and so there is not necessarily any teaching( TA is good at answering e-mails). We were basically given a book(not a very good one IMHO) and then assignments to churn out. We have a discussion board but are not able to paste in code so it is essentially useless to me. All I know is that my Assignment has to be formatted as LastName_A03Q1.Java and because of that my main class is named the same.
So in summation, I know absolutely nothing about Java. so little that I need a discussion forum to help me understand the people helping me in discussion forums....I feel like a toddler.
Roel De Nijs wrote:
Blake Edward wrote:I put the whole class in here, but really all you need to see is that "wwid" (which in the above post I referred to it as "employee_id") isn't mapped as the primary key anymore while "dbid" is. I recreated this class when I changed the primary key in my DB expecting the entire program to update along with it. I have scoured my application for any leftover code that still declares the "wwid" as primary key, but can't find any. My concern is that there is some metadata, a jar file, something else that still thinks my primary key is "wwid". The DB doesn't think this but the program I am building does.
So let's see if I understand your issue correctly. In a previous version of the application you used "wwid" as a primary key for the Spokespersons entity. But then decided that "dbid" is a much better choice. But now you get an exception when trying to update "employee_id" which is no longer a primary key anymore.
First of all, it's very confusing that you get an error on The attribute [employee_id] of class [DBClasses.Spokespersons], but that employee_id is not used at all in the entity class you just have shared. So it seems your application might be using an old version of this class. If that's not the case, could you share the actual error you currently get (which should complain about an attribute of the current class).
Secondly it seems you have a setDbid method in your entity. The primary key is generated by the database (according to the @GeneratedValue annotation). So you are definitely not setting the primary key explicitly when updating/creating an existing/new entity. Because some persistence providers don't like if you are updating the primary key (which makes sense in my opinion).
I'm not an EclipseLink expert (have been using Hibernate all the time), but maybe it's somehow related to the same issue described here.
Hope it helps!
Roel De Nijs wrote:Can you share the mapping of your entity, especially the field which is mapped as a primary key?