openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hewett" <>
Subject Forward Mapping Column Order
Date Thu, 02 Aug 2007 22:43:00 GMT
Is there a way to control the order of the columns in the tables
generated using forward mapping?  It seems that the columns come out
in the following order:

id column
other columns sorted alphabetically
foreign key columns

Is there a way to get the "other columns" in the order they are
declared in the Java class, or to specify the order in some other way?

I tried using XML metadata instead of annotations, but the following
also results in a table with columns ordered: id, a, b, c, d.

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns=""
	<entity class="com.example.TestEntity">
			<id name="id"></id>
			<basic name="c"></basic>
			<basic name="a"></basic>
			<basic name="d"></basic>
			<basic name="b"></basic>

Alphabetic ordering of fields make the data in the database hard to
browse since logically grouped columns are not together.


View raw message