[jboss-user] [JBoss Tools] - Hibernate Tools 4 Alpha @SequenceGenerator unique name ?
Nicolas Bihan
do-not-reply at jboss.com
Tue Sep 18 01:23:19 EDT 2012
Nicolas Bihan [https://community.jboss.org/people/nicotexas] created the discussion
"Hibernate Tools 4 Alpha @SequenceGenerator unique name ?"
To view the discussion, visit: https://community.jboss.org/message/760078#760078
--------------------------------------------------------------
Hi, I'm trying to get hbm2java (Eclipse tools 4) to generate my entities with EJB3 annotations to get the @GeneratedValue and @SequenceGenerator for my primary keys. Right now when generating my POJOs I get @SequenceGenerator(name = "generator", sequenceName = "S_CLIENT") @Id @GeneratedValue(strategy = SEQUENCE, generator = "generator") @Column(name = "CLIENT_ID", unique = true, nullable = false, precision = 22, scale = 0) public long getClientId() { return this.clientId; } Look OK but the problem is generator = "generator" that will be the same for every POJO hbm2java generates. I can't find any way to set the name for the SequenceGenerator. Tried with reveng.xml S_CLIENT true true and DelegatingReverseEngineeringStrategy @Override public Properties getTableIdentifierProperties(TableIdentifier identifier) { //@SequenceGenerator(name="APP_DEVDB_APPDEVDBID_GENERATOR", sequenceName="S_APP_DEVDB") Properties properties = new Properties(); properties.put("sequence", "S_"+identifier.getName()); properties.put("name", "Generator"+identifier.getName()); return properties; } public String getTableIdentifierStrategyName(TableIdentifier identifier) { return "sequence"; } Any way to change that behavior? Thanks....
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/760078#760078]
Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120918/448a9517/attachment.html
More information about the jboss-user
mailing list