cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Parkinson <ro...@senanque.co.nz>
Subject Configuring custom key generator
Date Thu, 26 Oct 2006 20:56:05 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I have extended JdbcPkGenerator to generate a custom primary key and it
works fine in unit testing.<br>
How do I tell Cayenne to use my class instead of standard&nbsp;
JdbcPkGenerator?<br>
<br>
Searching the messages reveals I should do something like:<br>
<br>
DbAdapter adapter = dataNode.getAdapter();<br>
PropertyUtils.setProperty(adapter,"pkGenerator",new
MyJdbcPkGenerator());<br>
<br>
But I don't know where to actually put this code so that it will use my
generator everywhere.<br>
Thanks<br>
<div class="moz-signature">-- <br>
<hr size="2" width="100%"><font color="#3366ff" face="Arial"><big>Roger
Parkinson</big><br>
+64 21 508 792<br>
</font><font face="Arial"><br>
</font></div>
</body>
</html>


Mime
View raw message