[Hibernate-JIRA] Commented: (HHH-1718) Have multiple bag fetches revert to subselect fetching for all but one of the bags
by Geoffrey De Smet (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1718?page=c... ]
Geoffrey De Smet commented on HHH-1718:
---------------------------------------
status: "Awaiting testcase", but apparently Sergey wrote one in the duplicate issue linked to this one :)
Sergey Koshcheyev - [01/Mar/07 09:13 AM ]
It seems that not only multiple bag fetches should be disallowed, but any multiple collection fetches which include a bag (with possibly some exceptions). For example, this currently fails for me on H3.2 from SVN (put this into ASTParserLoadingTest.java):
public void testBagSetFetchFails() {
Session s = openSession();
s.beginTransaction();
Human human = new Human();
human.setFriends(new ArrayList());
Human friend1 = new Human();
Human friend2 = new Human();
human.getFriends().add(friend1);
human.getFriends().add(friend2);
friend1.setNickNames(new TreeSet());
friend1.getNickNames().add("nick1");
friend1.getNickNames().add("nick2");
friend2.setNickNames(new TreeSet());
friend1.getNickNames().add("nick21");
friend1.getNickNames().add("nick22");
s.save(human);
s.save(friend1);
s.save(friend2);
s.getTransaction().commit();
s.close();
s = openSession();
human = (Human) s
.createQuery( "from Human h join fetch h.friends f join fetch f.nickNames nof" )
.uniqueResult();
assertTrue(Hibernate.isInitialized(human.getFriends()));
assertEquals(2, human.getFriends().size());
s.getTransaction().commit();
s.close();
}
> Have multiple bag fetches revert to subselect fetching for all but one of the bags
> ----------------------------------------------------------------------------------
>
> Key: HHH-1718
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1718
> Project: Hibernate3
> Issue Type: Improvement
> Components: core, query-criteria, query-hql
> Reporter: Steve Ebersole
> Assignee: Steve Ebersole
> Fix For: hql+collection
>
> Attachments: hibernate_eksempel.zip
>
>
> Follow on to HHH-1413. Multiple bag fetches were simply disallowed as the resolution to that particular case in the interest of working around that issue.
> The correct longer term solution is to not fetch all the bags at once, ideally reverting to subselect fetching for all but one of the bags.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 3 months
[Hibernate-JIRA] Commented: (ANN-354) @javax.persistence.SequenceGenerator defaults to 'seqhilo' strategy.
by Manoj Agrawal (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-354?page=co... ]
Manoj Agrawal commented on ANN-354:
-----------------------------------
I am also facing the same issue and just found out that this is actually a bug. Can somebody comment on why this is rejected?
> @javax.persistence.SequenceGenerator defaults to 'seqhilo' strategy.
> --------------------------------------------------------------------
>
> Key: ANN-354
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-354
> Project: Hibernate Annotations
> Issue Type: Improvement
> Affects Versions: 3.2.0.cr1
> Reporter: Andrey Petrov
>
> When using an oracle-style sequence to auto generate primary key values like this:
> @Id
> @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="MySeq")
> @SequenceGenerator(name="MySeq", sequenceName="ORACLE_SEQ")
> public long getId() {
> return id;
> }
> then a org.hibernate.id.SequenceHiLoGenerator is always used.
> There should be a way to configure a different generator!
> Since the hilo generator is not suitable for my application I have to use this instead:
> @Id
> @GeneratedValue(generator="MySeq")
> @GenericGenerator(
> //this is a hibernate-specific hack to force the use of a regular sequence generator
> //otherwise a sequencehilo generator is used by default :-(((
> name = "MySeq", strategy = "sequence", parameters = {
> @Parameter(name = "sequence", value = "ORACLE_SEQ")
> }
> )
> public long getId() {
> return id;
> }
> Now this works fine and while this solution can be tolerated for my app I really wish there was another way to control the default generator strategy (sequencehilo or plain sequence) without resorting to hibernate-specific org.hibernate.annotations.GenericGenerator annotations.
> Do you think a mechanism for configuring that can be added to a future hibernate annotations version?
> p.s.
> as long as i can see the seqhilo generation strategy is hardcoded in:
> org.hibernate.cfg.AnnotationBinder.java:1925: case SEQUENCE:
> org.hibernate.cfg.AnnotationBinder.java:1926: return "seqhilo";
> (in hibernate annotations version 3.2.0.cr1)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 3 months
[Hibernate-JIRA] Created: (HBX-998) descriptions of the XXXHome.java's methods
by william Armando Ceballos (JIRA)
descriptions of the XXXHome.java's methods
------------------------------------------
Key: HBX-998
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-998
Project: Hibernate Tools
Issue Type: Improvement
Components: eclipse
Affects Versions: 3.2.beta11
Environment: Eclipse europa v3.3, Hibernate 3.0 latest, Hibernate tools bundled eclipse europa, and Java server pages project
Reporter: william Armando Ceballos
Hi. I´m new in the Hibernate forum and I'm loocking for an answer about an issue I have.
I'm developing a project with eclipse europa v 3.3 and all your pluggins, I used the hibernate tool code generation and it generate me, of course, the code, but, how I'm a principiant with this tool, and I don't know really what's mean the files that it generate, so I need your help to be able to understand what's the utility for example of, MyClassHome.java, MyClass.java and MyClassId.java files, over all what the MyClassHome.java file do....my objective is to be able of implement DAO pattern with this files, and to do this, I need to know how to mannage this generated files and to know if I have to create another files to implement the DAO pattern with this generated code, so please help me!!....please give me a description abouth the MyClassHome's methods...
Thanks for all, if anyone could assist me with this, I'll be very grateful!!
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 3 months
[Hibernate-JIRA] Commented: (ANN-210) @ManyToOne not working wth @Formula
by Jason Long (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-210?page=co... ]
Jason Long commented on ANN-210:
--------------------------------
Any update on the status of this?
I just found a way to greatly improve my projects design if I can just use this feature.
I am using Seam 2.0.0 + EJB3.
Is there any way to use the hibernate mapping file only for the class that I need this functionality and still use the annotations for all other entities?
> @ManyToOne not working wth @Formula
> -----------------------------------
>
> Key: ANN-210
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-210
> Project: Hibernate Annotations
> Issue Type: Improvement
> Components: binder
> Affects Versions: 3.1beta7
> Environment: Hibernate 3.1, PostgreSQL 8.1.1
> Reporter: Jason Long
>
> This type of mapping fails:
> @ManyToOne
> @Formula(value="( select v_pipe_offerprice.offerprice_fk from v_pipe_offerprice where v_pipe_offerprice.id = id )")
> public OfferPrice getOfferPrice() { return offerPrice; }
> While the following mapping works as expected:
> <class name="Pipe" table="t_pipe">
> ...
> <many-to-one name="offerPrice"
> class="pipetracker.model.price.OfferPrice"
> formula="( select v_pipe_offerprice.offerprice_fk
> from v_pipe_offerprice
> where v_pipe_offerprice.id = id )"/>
> ...
> </class>
> This is not being treated as a formula because the generated SQL included a referece to the field pipe.offerprice_id which does not exsist because this is a virtual column calculated from a view.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 3 months
help
by pradeep kumar
Hi,
I am using Hibernate3.jar and using jboss server.
I am getting "could not register synchronization with JTA TransactionManager" in the server.
This problem comes when there is a failure in the transaction with the database. After getting this error i cannot able to procede further. Each time i need to restart the server.
[org.egov.infstr.utils.HibernateUtil] In getSessionFactory
2007-10-12 17:55:16,281 INFO [org.egov.infstr.utils.HibernateUtil] FactoryName java:/hibernate/EGovHibernateRamFactory
2007-10-12 17:55:16,281 DEBUG [org.egov.infstr.utils.HibernateUtil] Obtained session factory
2007-10-12 17:55:16,281 ERROR [org.egov.infstr.utils.HibernateUtil] Hibernate Exception opening session:could not register synchronization with JTA TransactionManager
2007-10-12 17:55:16,281 INFO [STDOUT] org.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:174)
at org.hibernate.jdbc.JDBCContext.<init>(JDBCContext.java:75)
at org.hibernate.impl.SessionImpl.<init>(SessionImpl.java:215)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:470)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:494)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:502)
at org.egov.infstr.utils.HibernateUtil.getCurrentSession(HibernateUtil.java:160)
at org.egov.infstr.utils.HibernateUtil.beginTransaction(HibernateUtil.java:247)
at org.egov.infstr.client.filter.HibSessionServletFilter.doFilter(HibSessionServletFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.egov.infstr.client.filter.SetEncodingFilter.doFilter(SetEncodingFilter.java:39)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.egov.infstr.client.filter.SetThreadLocals.doFilter(SetThreadLocals.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.transaction.RollbackException: Already marked for rollback TransactionImpl:XidImpl[FormatId=257, GlobalId=dma2/18, BranchQual=, localId=18]
at org.jboss.tm.TransactionImpl.registerSynchronization(TransactionImpl.java:602)
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:164)
Please help me in this regards,
Pradeep
---------------------------------
Get the freedom to save as many mails as you wish. Click here to know how.
17 years, 3 months
[Hibernate-JIRA] Commented: (HHH-1935) Hibernate produces invalid "create table" SQL for Maps on SQL Server 2000
by Hardy Ferentschik (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1935?page=c... ]
Hardy Ferentschik commented on HHH-1935:
----------------------------------------
There seem to be a bug in the schema export for SQLServer. The generate table create statement looks like this:
> create table A_B (A_id int not null, b_id int not null, mapkey varchar(255) null, primary key (A_id, mapkey), unique (b_id));
The problem is 'mapkey varchar(255) null' - you cannot have a nullable column in a multicolumn primary key. For other databases the script seems to be ok. , eg postgres
> create table A_B (A_id int4 not null, b_id int4 not null, mapkey varchar(255), primary key (A_id, mapkey), unique (b_id));
There is a workaround using the @MapKey annotation
@OneToMany
@MapKey(columns=@Column(name="mapkey", nullable=false))
private Map<A, B> b;
Using the @Column you can make sure that the mapkey column will be nullable.
> Hibernate produces invalid "create table" SQL for Maps on SQL Server 2000
> -------------------------------------------------------------------------
>
> Key: HHH-1935
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1935
> Project: Hibernate3
> Issue Type: Bug
> Affects Versions: 3.2.0.cr2
> Environment: Hibernate 3.2.0.cr2
> Microsoft SQL Server 2000
> Reporter: Bill Johnson
>
> I have two cases where Hibernate3 produces invalid SQL for MS SQL Server 2000:
> Case 1:
> @CollectionOfElements
> @org.hibernate.annotations.MapKey
> protected Map<String, String> properties;
> Case 2:
> @ManyToMany
> @MapKeyManyToMany
> private Map<A, B> b;
> In Case 2, A and B are entities creating a ternary relationship between the parent class, A and B, and I get the following log output:
> ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] - <Unsuccessful: create table A_B (A_id numeric(19,0) not null, b_id numeric(19,0) not null, key_id numeric(19,0) null, primary key (A_id, key_id), unique (key_id))>
> ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] - <Cannot define PRIMARY KEY constraint on nullable column in table 'A_B'.>
> Hibernate should not attempt to create a nullable primary key column by default on MS SQL Server.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 3 months
[Hibernate-JIRA] Created: (HBX-997) NPE with schema documentation export
by Xavier Poinsard (JIRA)
NPE with schema documentation export
------------------------------------
Key: HBX-997
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-997
Project: Hibernate Tools
Issue Type: Bug
Affects Versions: 3.2.beta11
Environment: Hibernate 3.2.5
Eclipse 3.3.1
Linux 64 bits
Reporter: Xavier Poinsard
Null Pointer Exception when trying to export schema documentation :
org.hibernate.tool.hbm2x.ExporterException: Error while processing template doc/entities/entity.ftl
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:257)
at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
at org.hibernate.tool.hbm2x.DocExporter.processTemplate(DocExporter.java:614)
at org.hibernate.tool.hbm2x.DocExporter.generateEntitiesDetails(DocExporter.java:436)
at org.hibernate.tool.hbm2x.DocExporter.doStart(DocExporter.java:162)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate$1.execute(CodeGenerationLaunchDelegate.java:245)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:88)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.runExporters(CodeGenerationLaunchDelegate.java:215)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:130)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:766)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:608)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:899)
at org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlugin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: freemarker.template.TemplateModelException: Method public org.hibernate.tool.hbm2x.doc.DocFile org.hibernate.tool.hbm2x.doc.DocFileManager.getEntityDocFileByDeclarationName(org.hibernate.tool.hbm2x.pojo.POJOClass) threw an exception when invoked on org.hibernate.tool.hbm2x.doc.DocFileManager@3045a87a
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136)
at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.ListLiteral.getModelList(ListLiteral.java:125)
at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:89)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.IfBlock.accept(IfBlock.java:82)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
at freemarker.core.Environment.visit(Environment.java:351)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:232)
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:251)
... 17 more
Caused by: java.lang.NullPointerException
at org.hibernate.util.StringHelper.qualifier(StringHelper.java:132)
at org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.getQualifiedDeclarationName(BasicPOJOClass.java:95)
at org.hibernate.tool.hbm2x.doc.DocFileManager.getEntityDocFileByDeclarationName(DocFileManager.java:391)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:616)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:113)
... 44 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 3 months