cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øyvind Harboe <>
Subject Regression in my application after switching to Cayenne 3.0.1/3.1 due to new feature
Date Fri, 18 Feb 2011 07:51:43 GMT
I had to fix a regression in my application switching to Cayenne 3.1:

Previously when I had a table that didn't have a primary key set in
MS SQL, things would work fine, now I get this error message:

[v.3.1-SNAPSHOT Jan 18 2011 07:59:35] Won't be able to create ObjectId
for 'Users'. Reason: DbEntity 'users' has no Primary Key defined.

The problem turned out to be that my application now has to check
for a new kind of merger token. When checking the model against the database,
I want to update the model with e.g. length of string fields, etc. This allows
database maintainers to simply modify the length of string column using
their beloved MS SQL Manager.

			if (token.getDirection() == MergeDirection.TO_DB)
				token = token.createReverse(dataNode.getAdapter()

			if (token instanceof SetPrimaryKeyToModel)
                                // NEW!!!!
				// We don't care if the database has a primary key or not, skip!

Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 87 40 27
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

View raw message