Re: [hibernate-dev] How to configure schema name for mapped entity / table in JPA / hibernate
Hi, I once had a similar requirement, which was easily resolved by implementing a custom NamingStrategy http://docs.jboss.org/hibernate/core/4.1/manual/en-US/html_single/#configuration-namingstrategy You could either have two different strategies, or have one which reads some configuration file. Alternatively you could use XML mapping. Sanne On 4 September 2012 04:29, Tang Jianyu wrote: > Hi, > > I have a question posted to stackoverflow but haven't get answer, so > want to check if someone here can help me > > http://stackoverflow.com/questions/12192453/how-to-configure-schema-name-for-mapped-entity-table-in-jpa-hibernate > > I have an application which need to access 2 schemas at runtime, and > the schema names need to be configured when deploy, because the name > are different for each deployment (for assembly testing, integration > testing, performance testing...) > > I know JPA / hibernate can specify schema on @Table annotation, but I > need to make the schema configurable, is there anyway to add a post > processor / event listener so I can modify the hibernate meta info, > and change the table schema with my configuration? > > Currently I'm looking into rewrite my own HibernateJpaVendorAdapter / > HibernatePersistence / MetaProvider, but definitely this is not a good > idea. > > Thanks > > Jeffrey > ___ > hibernate-dev mailing list > hibernate-dev@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
[hibernate-dev] Hibernate search master build issues
Hi all, Since ~10 days, I do have build issue with master branch : Failed tests: searchNewMemberBeforeSynchronizationOnSlave1(org.hibernate.search.test.integration.jms.SearchBeforeIndex SynchronizationJmsMasterSlaveIT): Found user created by Slave 1: [[1, Davide D'Alto, d...@slave1.fake.email]] expected:<0> but was:<1> searchNewMemberBeforeSynchronizationOnSlave2(org.hibernate.search.test.integration.jms.SearchBeforeIndexSynchronizatio nJmsMasterSlaveIT): Found user created by Slave 1: [[1, Davide D'Alto, d...@slave1.fake.email]] expected:<0> but was:<1> Any changes on this ? Niko ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] Hibernate search master build issues
Hi, Sounds this is related to HSEARCH-1179. Before the changes for HSEARCH-1179 the test would fail on my system :-) I was hoping the problem was gone, but since you (and I think Sanne) seem to have problems now, there might be yet another issue. Personally I feel these tests start taking too much time to maintain and troubleshoot and I am almost tempted to disable them. There seems too many moving parts in them. --Hardy On 4 Jan 2012, at 4:32 PM, Nicolas Helleringer wrote: > Hi all, > > Since ~10 days, I do have build issue with master branch : > > Failed tests: > searchNewMemberBeforeSynchronizationOnSlave1(org.hibernate.search.test.integration.jms.SearchBeforeIndex > SynchronizationJmsMasterSlaveIT): Found user created by Slave 1: [[1, > Davide D'Alto, d...@slave1.fake.email]] expected:<0> > but was:<1> > > searchNewMemberBeforeSynchronizationOnSlave2(org.hibernate.search.test.integration.jms.SearchBeforeIndexSynchronizatio > nJmsMasterSlaveIT): Found user created by Slave 1: [[1, Davide D'Alto, > d...@slave1.fake.email]] expected:<0> but was:<1> > > Any changes on this ? > > Niko > ___ > hibernate-dev mailing list > hibernate-dev@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] Hibernate search master build issues
On 4 Jan 2012, at 4:40 PM, Nicolas Helleringer wrote: > Yes > > They are +very+ local hardware/environnement sensitive It definitely seems like it. --Hardy ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] Hibernate search master build issues
Yes since that pull, which Emmanuel merged (so I guess it's working fine for him too) it's consistently broken for me, and for our Jenkins instances too. I spent and hour on it yesterday but couldn't understand it. The failure I have is HornetQ not being able to boot in AS7, then our test fails as it depends on JMS.; It fails consistently when using the build.sh script which forks my repository before starting the tests, but I noticed that it occasionally doesn't fail if I run "mvn" directly. Running mvn directly means running the tests on an ext4 partition; when I use the build script it actually clones to a ramfs mount; looking at HornetQ's JIRA for issues I understood that its native component is indeed partition-sensitive so I was about to open an issue there... but then it started failing me on ext4 as well so I'm back to square 1: clueless. Still since it's AS7 failing to boot a service way before we even start deploying our test WAR, I wouldn't blame our test... just weird that this is broken after your test changes. Now if only you hadn't reformatted all whitespace I would be glad to compare the files :) I will resume the inspection later. Cheers, Sanne On 4 September 2012 16:47, Hardy Ferentschik wrote: > > On 4 Jan 2012, at 4:40 PM, Nicolas Helleringer wrote: > >> Yes >> >> They are +very+ local hardware/environnement sensitive > > It definitely seems like it. > > --Hardy > > ___ > hibernate-dev mailing list > hibernate-dev@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
[hibernate-dev] Problem with MappedSuperclass
Hello! I have a strange problem, which I don't have in my company related to the usage of mapped superclasses. I have a base entity which encapsulates the id like this: @MappedSuperclass public abstract class SimpleEntity implements Serializable { private static final long serialVersionUID = 1L; private T id; @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idGenerator") @Column(name = "id", nullable = false, insertable = false, updatable = false) public T getId() { return id; } public void setId(T id) { this.id = id; } } A concrete class example looks like: @Entity @SequenceGenerator(name = "idGenerator", sequenceName = "my_entity_seq", initialValue = 1, allocationSize = 1) public class MyEntity extends SimpleEntity { private static final long serialVersionUID = 1L; private String name; public String getName() { return name; } public void setName(T name) { this.name = name; } } But when I try to start the application I get the following error: Caused by: org.hibernate.AnnotationException: Unknown Id.generator: idGenerator at org.hibernate.cfg.BinderHelper.makeIdGenerator(BinderHelper.java:507) at org.hibernate.cfg.AnnotationBinder.processId(AnnotationBinder.java:2126) at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:2038) at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:765) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:684) at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3406) at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3360) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1334) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1724) at org.hibernate.ejb.EntityManagerFactoryImpl.(EntityManagerFactoryImpl.java:84) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904) ... 9 more This is just a simple example, anyway I have a lot of mapped super classes in my app. Any ideas what the cause of the error might be? The message is not really helpful, also it doesn't point out where the error occurred. Regards, Christian ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] Hibernate search master build issues
On 4 Jan 2012, at 5:11 PM, Sanne Grinovero wrote: > I spent and hour on it yesterday but couldn't understand it. The > failure I have is HornetQ not being able to boot in AS7, then our test > fails as it depends on JMS.; It fails consistently when using the > build.sh script which forks my repository before starting the tests, > but I noticed that it occasionally doesn't fail if I run "mvn" > directly. > > Running mvn directly means running the tests on an ext4 partition; > when I use the build script it actually clones to a ramfs mount; > looking at HornetQ's JIRA for issues I understood that its native > component is indeed partition-sensitive so I was about to open an > issue there... but then it started failing me on ext4 as well so I'm > back to square 1: clueless. > > Still since it's AS7 failing to boot a service way before we even > start deploying our test WAR, I wouldn't blame our test... just weird > that this is broken after your test changes. Now if only you hadn't > reformatted all whitespace I would be glad to compare the files :) I > will resume the inspection later. My initial guess for the new failures wold have been my change to RegistrationConfiguration#createTempDir. I thought maybe the temp directory does not get deleted properly. But then again, I have not seen the error yet and it does not seem related to HornetQ. --Hardy ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] How to configure schema name for mapped entity / table in JPA / hibernate
Thank you, this looks better than customize the meta provider and annotation reader. On 9/4/12 15:17 PM, Sanne Grinovero wrote: > Hi, > I once had a similar requirement, which was easily resolved by > implementing a custom NamingStrategy > > http://docs.jboss.org/hibernate/core/4.1/manual/en-US/html_single/#configuration-namingstrategy > > You could either have two different strategies, or have one which > reads some configuration file. > > Alternatively you could use XML mapping. > > Sanne > > On 4 September 2012 04:29, Tang Jianyu wrote: >> Hi, >> >> I have a question posted to stackoverflow but haven't get answer, so >> want to check if someone here can help me >> >> http://stackoverflow.com/questions/12192453/how-to-configure-schema-name-for-mapped-entity-table-in-jpa-hibernate >> >> I have an application which need to access 2 schemas at runtime, and >> the schema names need to be configured when deploy, because the name >> are different for each deployment (for assembly testing, integration >> testing, performance testing...) >> >> I know JPA / hibernate can specify schema on @Table annotation, but I >> need to make the schema configurable, is there anyway to add a post >> processor / event listener so I can modify the hibernate meta info, >> and change the table schema with my configuration? >> >> Currently I'm looking into rewrite my own HibernateJpaVendorAdapter / >> HibernatePersistence / MetaProvider, but definitely this is not a good >> idea. >> >> Thanks >> >> Jeffrey >> ___ >> hibernate-dev mailing list >> hibernate-dev@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev > ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
[hibernate-dev] 4.1.7
Tomorrow is the timebox for 4.1.7 release. Anything you want in 4.1.7 please be sure to get finished up and pushed to the 4.1 branch. -- st...@hibernate.org http://hibernate.org ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
[hibernate-dev] Jira issue links
Saw something pretty cool today in Jira. Not sure when it was added, but you can now link Jira issues to random urls. For example, here is an issue I linked to its JBPAPP counterpart : https://hibernate.onjira.com/browse/HHH-7563 Was thinking we might want to do that for GitHub pull-requests as well and get rid of the JBoss Jira plugin... -- st...@hibernate.org http://hibernate.org ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] Jira issue links
- Original Message - > From: "Steve Ebersole" > To: "Hibernate hibernate-dev" > Sent: Tuesday, September 4, 2012 1:16:55 PM > Subject: [hibernate-dev] Jira issue links > > Saw something pretty cool today in Jira. Not sure when it was added, > but you can now link Jira issues to random urls. > > For example, here is an issue I linked to its JBPAPP counterpart : > https://hibernate.onjira.com/browse/HHH-7563 That's definitely nicer than just putting the url in a comment. > > Was thinking we might want to do that for GitHub pull-requests as > well > and get rid of the JBoss Jira plugin... I noticed there's a field for pull requests in the search screen. Would that still be usable? Gail > > > -- > st...@hibernate.org > http://hibernate.org > ___ > hibernate-dev mailing list > hibernate-dev@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev