Skip to Content
0
Former Member
Aug 03, 2005 at 02:52 PM

Dictionary and Entity Beans

12 Views

Hello all,

I'm quite new to NetWeaver J2EE development and maybe I didn't read enough or I just expect too much, but anyway, let me explain my problem to you:

I want to maintain - let's say - emergency vehicles in a database using cmp entity beans. My vehicles can have a special status that is one of: "Ready", "OnMisson", "Returning".

For that I created a simple type in my NW dictionary project. It's based on the built in type string and is basically an enumeration. I ticked the "Generate a class representation of the enumeration" checkbox, that I'll need later on.

I created a database table vehicles (in my dictionary project) as well, which has - among license plate, model, manufacturer, etc. - a field called status. I chose my created SimpleType from step one for that column. I created the archive and deployed the dict proj. Fine.

Then I created a cmp entity bean. Fields are the same as in my table. I set the type of the status field to the class that NW IDE created according to my simpletype before (that's why i ticked the checkbox).

The column matching in persistent.xml works like a charm, no errors or anything.

Anyways, when I want to deploy my EAR, I get an error saying that the class VehicleType (which was generated by NW IDE!) doesn't implement Serializable. Just because I was curious about it, i added "implements Serializable" to the generated class and tried to deploy again. Now it's complaining that the field cannot be mapped to VARCHAR - it expects BLOB. Well, I'm using MaxDB which doesn't support BLOB. I got stuck.

I think that after all serializing the object and storing it as a blob is not the right way as we do know the possible values and the base type (string) such that a simple mapping to a varchar would be an easy thing to do for the bean container.

Am I missing something?

Do you agree that it should be working as I did it (just from a functional point of view)?

Is there a better way to do that kind of stuff?

Thank you for any input. Best regards.

jan