You can subscribe to this list here.
2002 |
Jan
(2) |
Feb
(157) |
Mar
(111) |
Apr
(61) |
May
(68) |
Jun
(45) |
Jul
(101) |
Aug
(132) |
Sep
(148) |
Oct
(227) |
Nov
(141) |
Dec
(285) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(518) |
Feb
(462) |
Mar
(390) |
Apr
(488) |
May
(321) |
Jun
(336) |
Jul
(268) |
Aug
(374) |
Sep
(211) |
Oct
(246) |
Nov
(239) |
Dec
(173) |
2004 |
Jan
(110) |
Feb
(131) |
Mar
(85) |
Apr
(120) |
May
(82) |
Jun
(101) |
Jul
(54) |
Aug
(65) |
Sep
(94) |
Oct
(51) |
Nov
(56) |
Dec
(168) |
2005 |
Jan
(146) |
Feb
(98) |
Mar
(75) |
Apr
(118) |
May
(85) |
Jun
(75) |
Jul
(44) |
Aug
(94) |
Sep
(70) |
Oct
(84) |
Nov
(115) |
Dec
(52) |
2006 |
Jan
(113) |
Feb
(83) |
Mar
(217) |
Apr
(158) |
May
(219) |
Jun
(218) |
Jul
(189) |
Aug
(39) |
Sep
(3) |
Oct
(7) |
Nov
(4) |
Dec
(2) |
2007 |
Jan
|
Feb
(2) |
Mar
(7) |
Apr
(3) |
May
(3) |
Jun
(8) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(7) |
Dec
|
2008 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2009 |
Jan
(6) |
Feb
|
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(10) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Urberg, J. <ju...@ve...> - 2002-07-15 13:02:55
|
I have a first shot at a JBoss MBean to set up Hibernate. You might want to modify it a bit so it works with the configure functionality. To compile, you need jboss.jar and jmxri.jar in your class path. Jar it up and put in %JBOSS_DIST%/lib/ext along with the hibernate jars. Add the following to jboss.jmcl and your good to go: <mbean code="hibernate.HibernateIntegration" name="DefaultDomain:service=Hibernate,name={your factory name here}"> <attribute name="MappingFile">../conf/catalina/mapping.hbm.xml</attribute> <attribute name="Datasource">{your datasource}</attribute> <attribute name="JndiName">{your factory name here}</attribute> <attribute name="UserName"></attribute> <attribute name="Password"></attribute> <attribute name="ShowSql">false</attribute> <attribute name="UseOuterJoin">true</attribute> </mbean> HibernateIntegrationMBean.java ------------------------------- import org.jboss.util.ServiceMBean; /** * Interface definition for JMX Bean that manages Hibernate */ public interface HibernateIntegrationMBean extends ServiceMBean { public String getMappingFile(); public void setMappingFile(String aMappingFile); public String getDatasource(); public void setDatasource(String aDatasource); public boolean getShowSql(); public void setShowSql(boolean aFlag); public String getJndiName(); public void setJndiName(String aJndiName); public boolean getUseOuterJoin(); public void setUseOuterJoin(boolean aFlag); public String getUserName(); public void setUserName(String aUserName); public String getPassword(); public void setPassword(String aPassword); } HibernateIntegration.java ------------------------- import java.io.Serializable; import java.sql.Connection; import java.sql.SQLException; import java.util.Properties; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.Name; import javax.naming.NameNotFoundException; import javax.naming.NamingException; import org.jboss.util.ServiceMBeanSupport; import cirrus.hibernate.Databinder; import cirrus.hibernate.Datastore; import cirrus.hibernate.Hibernate; import cirrus.hibernate.HibernateException; import cirrus.hibernate.Session; import cirrus.hibernate.SessionFactory; /** * Implementation of Hibernate mbean. Creates a Hibernate Session Factory and * binds it to the specified JNDI name. */ public class HibernateIntegration extends ServiceMBeanSupport implements HibernateIntegrationMBean, SessionFactory, Serializable { protected String mappingFile; protected String datasource; protected String jndiName; protected String userName; protected String password; protected boolean showSql; protected boolean useOuterJoin; protected SessionFactory factory; /** * The name of the current bean * @return String */ public String getName() { return "Hibernate Session Factory (" + jndiName + ")"; } /** * The Hibernate mapping file * @return String */ public String getMappingFile() { return mappingFile; } /** * The Hibernate mapping file * @param String */ public void setMappingFile(String aMappingFile) { mappingFile = aMappingFile; } /** * The JNDI name of the datasource to use in this session factory * @return String */ public String getDatasource() { return datasource; } /** * The JNDI name of the datasource to use in this session factory * @param String */ public void setDatasource(String aDatasource) { datasource = aDatasource; } /** * Show the SQL in the server log * @return boolean */ public boolean getShowSql() { return showSql; } /** * Show the SQL in the server log * @param boolean */ public void setShowSql(boolean aFlag) { showSql = aFlag; } /** * The JNDI name to bind the session factory to * @return String */ public String getJndiName() { return jndiName; } /** * The JNDI name to bind the session factory to * @param String */ public void setJndiName(String aJndiName) { jndiName = aJndiName; } /** * This datasource supports outer joins * @return boolean */ public boolean getUseOuterJoin() { return useOuterJoin; } /** * This datasource supports outer joins * @param boolean */ public void setUseOuterJoin(boolean aFlag) { useOuterJoin = aFlag; } /** * Log into the database with this name * @return String */ public String getUserName() { return userName; } /** * Log into the database with this name * @param String */ public void setUserName(String aUserName) { userName = aUserName; } /** * Log into the database with this password * @return String */ public String getPassword() { return password; } /** * Log into the database with this password * @param String */ public void setPassword(String aPassword) { password = aPassword; } /** * Create the SessionFactory and bind to the jndi name on startup */ public void startService() throws Exception { Datastore ds = Hibernate.createDatastore().storeFile(mappingFile); Properties props = new Properties(); props.put("hibernate.datasource", datasource); props.put("hibernate.username", userName); props.put("hibernate.password", password); props.put("hibernate.show_sql", String.valueOf(showSql)); props.put("hibernate.use_outer_join", String.valueOf(useOuterJoin)); factory = ds.buildSessionFactory(props); bind(new InitialContext(), "java:/" + jndiName, this); log.info("Hibernate Session Factory bound to java:/" + jndiName); } /** * Unbind the Session factory from JNDI */ public void stopService() { try { new InitialContext().unbind("java:/" + jndiName); } catch (NamingException e) {} } /** * @see cirrus.hibernate.SessionFactory#openDatabinder() */ public Databinder openDatabinder() throws HibernateException { return factory.openDatabinder(); } /** * @see cirrus.hibernate.SessionFactory#openSession() */ public Session openSession() throws SQLException { return factory.openSession(); } /** * @see cirrus.hibernate.SessionFactory#openSession(Connection) */ public Session openSession(Connection connection) { return factory.openSession(connection); } /** * Bind val to name in ctx, and make sure that all intermediate contexts exist * @param Context * @param Name * @param Object * @throws NamingException */ protected void bind(Context ctx, String name, Object val) throws NamingException { Name n = ctx.getNameParser("").parse(name); while (n.size() > 1) { String ctxName = n.get(0); try { ctx = (Context)ctx.lookup(ctxName); } catch (NameNotFoundException e) { ctx = ctx.createSubcontext(ctxName); } n = n.getSuffix(1); } ctx.bind(n.get(0), val); } } |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-15 02:15:03
|
I spent much of the weekend programming and and added support for queries returning properties and aggregate values. These queries only work with iterate() currently ( ie. not with find() ). You can write stuff like select foo.id, foo.name from foo in class Foo where foo.bar.name = 'bar' select count(*), count(distinct foo.baz), sum(foo.count), foo.type from foo in class eg.Foo group by foo.type This fills a very old feature request. Implementing this required some reworking of the query translater. If people here could grab a CVS snapshot and test this new implementation against their current system (and also test the new functionality) I would really appreciate that. I also fixed a problem with JNDI lookup of SessionFactory and fixed some problems with lifecycle load() and onLoad() callbacks. Earlier in the week I changed the ordering in which save() and delete() are cascaded to collections. This improves the behaviour where there are not-null constraints. It also optimizes performance of one-to-many bidirectional associations. However there is a (very) small possibility of breaking existing code so be aware of that. I want to release all this in version 1.0.1 (in the next couple of days). Gavin |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-13 07:17:56
|
>If this code runs as standalone application all execute without errors. >But when this code runs inside my web application (Tapestry framework >2.1 under Jetty 4.0.1 web server) throws exception in last string > >java.lang.ClassCastException avp.forum.biz.Forum > >The type of object witch returned by iterator is avp.forum.biz.Forum. >This is means that object not want to cast to his real type. >I think that is because of different ClassLoaders. >Can anybody help me? How to avoid this error? Don't know anything about classloaders in Jetty, so can't help you on this one ... I'll leave that for others.... might even be better to ask on a Jetty mailing list. >And another problem. > ><!DOCTYPE hibernate-mapping SYSTEM >"http://hibernate.sourceforge.net/hibernate-mapping.dtd"> >When I use DOCTYPE string in my *.hbm.xml file throws exception. If you wish to use a SYSTEM id, rather than a PUBLIC id, you should provide the absolute path to the mapping dtd, ie. "C:/hibernate-1.0/src/cirrus/hibernate/hibernate-mapping.dtd" but this is not recommended. Try using the PUBLIC id recommended in the documentation: <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping.dtd"> This will NOT actually hit the given URL. Instead it will load the mapping DTD from the classpath. Hope that helps. Peace. Gavin P.S. please post these kind of questions to the forum, rather than the devel list, so other users will be able to find the answers..... TIA. |
From: anatol <ana...@pm...> - 2002-07-12 18:30:51
|
There are interesting thing In my application I wrote List list = sess.find("from forum in class avp.forum.biz.Forum"); Forum[] res = new Forum[list.size()]; Iterator iter = list.iterator(); for( int i = 0; i < res.length; i++ ) res[i] = (Forum)iter.next(); If this code runs as standalone application all execute without errors. But when this code runs inside my web application (Tapestry framework 2.1 under Jetty 4.0.1 web server) throws exception in last string java.lang.ClassCastException avp.forum.biz.Forum The type of object witch returned by iterator is avp.forum.biz.Forum. This is means that object not want to cast to his real type. I think that is because of different ClassLoaders. Can anybody help me? How to avoid this error? And another problem. <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping.dtd"> When I use DOCTYPE string in my *.hbm.xml file throws exception. XMLHelper [INFO] Parsing XML: unknown system id RelationalDatastore [ERROR] Could not configure datastore from input stream java.lang.NullPointerException at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:257) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.jav a:209) at cirrus.hibernate.helpers.XMLHelper.parseInputSource(XMLHelper.java:48) at cirrus.hibernate.impl.RelationalDatastore.storeInputStream(RelationalDat astore.java:147) at cirrus.hibernate.impl.RelationalDatastore.storeClass(RelationalDatastore .java:166) at avp.forum.util.SessionHolder.init(SessionHolder.java:26) at avp.forum.webapp.ForumServlet.init(ForumServlet.java:30) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at net.sf.tapestry.ApplicationServlet.init(ApplicationServlet.java:408) at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:225) at org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandl er.java:414) at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationCont ext.java:446) at org.mortbay.http.HttpServer.start(HttpServer.java:189) at org.mortbay.jetty.Server.main(Server.java:349) ForumServlet [ERROR] Hibernate mapping problem: null But when don't use one than throws another: XMLHelper [INFO] Parsing XML: unknown system id XMLHelper [ERROR] Error parsing XML: unknown system id(2) org.xml.sax.SAXParseException: Document root element "hibernate-mapping", must match DOCTYPE root "null". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Error HandlerWrapper.java:232) at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.jav a:173) at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.jav a:362) at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.jav a:296) at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(XMLDTDVa lidator.java:2564) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDVali dator.java:2878) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator. java:804) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(X MLDocumentFragmentScannerImpl.java:752) at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRoot ElementHook(XMLDocumentScannerImpl.java:927) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1519) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo cumentFragmentScannerImpl.java:333) at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardPars erConfiguration.java:525) at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardPars erConfiguration.java:581) at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147) at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:221) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.jav a:209) at cirrus.hibernate.helpers.XMLHelper.parseInputSource(XMLHelper.java:48) at cirrus.hibernate.impl.RelationalDatastore.storeInputStream(RelationalDat astore.java:147) at cirrus.hibernate.impl.RelationalDatastore.storeClass(RelationalDatastore .java:166) at avp.forum.util.SessionHolder.init(SessionHolder.java:26) at avp.forum.webapp.ForumServlet.init(ForumServlet.java:30) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at net.sf.tapestry.ApplicationServlet.init(ApplicationServlet.java:408) at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:225) at org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandl er.java:414) at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationCont ext.java:446) at org.mortbay.http.HttpServer.start(HttpServer.java:189) at org.mortbay.jetty.Server.main(Server.java:349) Can anybody explain me what's wrong? |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-05 04:12:02
|
Okey, looks like lots of people have had a chance to download + try out the latest rc, so if no-one throws any last minute bugs my way in the next few hours, I will rename 1.0rc3 to 1.0final. At last :) |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-05 00:40:04
|
>I know, i'm actually gradually improving this. Just last >night I added an new example section to the collections >documentation. Its up at the main website if that helps.... Unfortunately there is a small bug in one of the example mappings. The <one-to-many> element never takes a column attribute...... I will fix this tonight. |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-05 00:16:24
|
>In a nutshell, there is a one-to-many relationship from >class productSpecifcation to class panelSpecification. > >I want to model this using a nested collection. >.... >Question: What have I got wrong with my mapping file? > ><list role="panels" table="panel_specification" lazy="false" cascade ="none" > > <key column="product_type_id" type="long" /> > <index column="product_type_id" type="long"/> > <element column="id" type="long"/> ></list> Should be something more like: <list role="panels" table="panel_specification" lazy="false" cascade="none" > <key column="product_type_id" type="long"/> <index column="panel_index"/> <one-to-many class="com.psaunders.project.PanelSpecification"/> </list> The index column holds the index of the panel in the list. If you don't care about panel ordering, you should use a set instead of a list. oh .. .and cascade defaults to "none", so you can leave it off. > <property name="productTypeId" column="product_type_id"/> Are you sure you don't want a <many-to-one> here? It actually looks like you might *really* be trying to do is map a bidirectional one-to-many association. (In which case you need a <set>, not a <list>.) Have a look at the section on bidirectional associations in the programming guide. > Also, I don't understand the use of the <element> tag > in the declaration of my <list>. The docs are a bit > vague on this. The <element> tag is used for collections of _values_ not for associations between _entities_. (ie. if you wanted to map a list of strings or dates.) >Though the manual is detailed, I reckon a few more examples >of common things done would answer 95% of newbie questions. I know, i'm actually gradually improving this. Just last night I added an new example section to the collections documentation. Its up at the main website if that helps.... Unfortunately mapping collections is kinda complicated at first. This is because Hibernate supports * collections of values (including components) as well as associations * indexed collections like maps + lists * subcollections / toplevel collections so when a new user comes along and wants to know how to map a simple one-to-many association, they have to sort through a whole bunch of more complicated stuff..... hope that helps Gavin P.S. its better to post these kind of questions to the users forum on the sourceforge project page. |
From: Patrick S. <psa...@co...> - 2002-07-04 17:20:47
|
Hi Guys, I've recently got back onto my hibernate project and like it _very_ much. I am having a little difficulty nesting a class in another - perhaps someone can easily pinpoint where I'm going wrong. In a nutshell, there is a one-to-many relationship from class productSpecifcation to class panelSpecification. I want to model this using a nested collection. When I retrieve a ProductSpecification object I want to get the corresponding panelSpecification objects also. Question: What have I got wrong with my mapping file? Also, I don't understand the use of the <element> tag in the declaration of my <list>. The docs are a bit vague on this. Though the manual is detailed, I reckon a few more examples of common things done would answer 95% of newbie questions. I am using version 1.0rc2 . Any tips much appreciated. Thanks, Patrick. ======================== Mapping file================== <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "file://localhost//usr/local/hibernate-1.0rc2/src/cirrus/hibernate/hibernate-mapping.dtd"> <hibernate-mapping> <class name="com.psaunders.project.ProductSpecification" table="product_specification" select="all"> <id name="productTypeId" column="product_type_id" type="long"> <generator class="sequence"/> </id> <property name="longDesc" column="long_desc"/> <property name="shortDesc" column="short_desc"/> <list role="panels" table="panel_specification" lazy="false" cascade="none" > <key column="product_type_id" type="long" /> <index column="product_type_id" type="long"/> <element column="id" type="long"/> </list> <collection name="panelName" column="panel_name" role="panels" /> <collection name="productTypeId" column="product_type_id" role="panels" /> <collection name="zOrder" column="z_order" role="panels" /> </class> <class name="com.psaunders.project.PanelSpecification" table="panel_specification" select="all"> <id name="id" column="uid" type="long"> <generator class="sequence"/> </id> <property name="productTypeId" column="product_type_id"/> <property name="panelName" column="panel_name"/> <property name="zOrder" column="z_order"/> </class> </hibernate-mapping> ================================================= ========== DDL for schema ================ drop table panel_specification drop table product_specification drop sequence hibernate_sequence create table panel_specification (panel_name VARCHAR(255), product_type_id INT4, uid INT8 not null, z_order INT4, primary key (uid)) create table product_specification (long_desc VARCHAR(255), product_type_id INT8, short_desc VARCHAR(255), primary key (product_type_id)) alter table panel_specification add constraint panel_specificationFK0 foreign key (product_type_id) references product_specification create index panel_specificationIDX1 on panel_specification (product_type_id) ======================================== |
From: Jon L. <jon...@xe...> - 2002-07-02 13:06:34
|
Thanks Gavin, Yes, that will work... That select was in some legacy code and I was just trying to replace it like it was. (To many hours staring at other people code :-) I guess I owe you a beer for saving me some time... I like the idea of your select with the [] syntax. I'll take a look to see if that would reduce the number of classes I need somewhere, and if so I'll try to add it. I'll keep you posted... Cheers, Jon... ----- Original Message ----- From: <Gavin_King/Cirrus%CI...@ci...> To: "Jon Lipsky" <jon...@xe...> Cc: <hib...@li...> Sent: Tuesday, July 02, 2002 2:32 AM Subject: Re: [Hibernate-devel] Is this type of query possible? > > > Basically, there is a parent table ("foo" in my example above) and > > there is list of attributes for a particular foo object > > (called "foo_attr") in my example above. I want to find all Foo's > > where it have an attribute "attribute1" equal to "value1" and an > > attribute "attribute2" equal to "value2". > > > > So, is this something I will have to implement (and if so, are there > > suggestions on the syntax of the query), or does this already exist? > > I *think* I understand what you are trying to do though I'm not sure > why you used a nested subselect so perhaps there is something I'm > missing. > > If you were to map this as a (nested) one-to-many set of Attibutes, I > think you can express this as: > > select foo > from foo in class Foo, att1 in foo.attributes, att2 in foo.attributes > where att1.name = 'attribute1' and att1.value = 'value1' > and att2.name='attribute2' and att2.value = 'value2' > > (though the generated SQL here contains no subselects). What I would > love to be able to do would be to map this instead as a (nested) map > with String index + element and then express the query as: > > from foo in class Foo > where foo.attributes['attribute1']='value1' > and foo.attributes['attribute2']='value2' > > However, the [] indexing syntax is not implemented. The advantage of > this approach is we don't have to invent this whole new class called > Attribute to contain name/value pairs. If someone wants to implement > [], that would be wonderful - but it might be nontrivial. > > Does that help? > |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-02 01:05:33
|
Telstra sux...... > fyi: we r running rc1 on a live system using SAP DB. Excellent :) How many users? > also, i will look over the code generator tonight to c what > state it is in. there is a new patch for this if you hadn't noticed yet... |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-02 00:52:12
|
Late last night I also added support for foreign key constraint export to the SAP dialect. This required some changes to Dialect since SAP has a wierd ALTER TABLE syntax. Anyhow, that should be a big plus for people working with SAP DB. :) |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-02 00:47:43
|
> Basically, there is a parent table ("foo" in my example above) and > there is list of attributes for a particular foo object > (called "foo_attr") in my example above. I want to find all Foo's > where it have an attribute "attribute1" equal to "value1" and an > attribute "attribute2" equal to "value2". > > So, is this something I will have to implement (and if so, are there > suggestions on the syntax of the query), or does this already exist? I *think* I understand what you are trying to do though I'm not sure why you used a nested subselect so perhaps there is something I'm missing. If you were to map this as a (nested) one-to-many set of Attibutes, I think you can express this as: select foo from foo in class Foo, att1 in foo.attributes, att2 in foo.attributes where att1.name = 'attribute1' and att1.value = 'value1' and att2.name='attribute2' and att2.value = 'value2' (though the generated SQL here contains no subselects). What I would love to be able to do would be to map this instead as a (nested) map with String index + element and then express the query as: from foo in class Foo where foo.attributes['attribute1']='value1' and foo.attributes['attribute2']='value2' However, the [] indexing syntax is not implemented. The advantage of this approach is we don't have to invent this whole new class called Attribute to contain name/value pairs. If someone wants to implement [], that would be wonderful - but it might be nontrivial. Does that help? |
From: Jon L. <jon...@xe...> - 2002-07-01 15:23:27
|
Hi, I've managed to get all of my direct JDBC calls replaced except for one. = I can't figure out how to write this particular query using the = hibernate query language, so I'm not even sure it is possible. If it's = not possible then I'll take the time to implement it, however I wanted = to make sure first. Below is an example of the resulting SQL that I want to create: select foo.id, foo.name from foo where foo.id in ( select foo_attr.id_foo from foo_attr where (foo_attr.id_attribute =3D 'attribute1' and foo_attr.strvalue = =3D 'value1')=20 and id_foo in ( select foo_attr.id_foo from foo_attr where (foo_attr.id_attribute =3D 'attribute2' and = foo_attr.strvalue =3D 'value2')=20 ) ) Basically, there is a parent table ("foo" in my example above) and there = is list of attributes for a particular foo object (called "foo_attr") in = my example above. I want to find all Foo's where it have an attribute = "attribute1" equal to "value1" and an attribute "attribute2" equal to = "value2". So, is this something I will have to implement (and if so, are there = suggestions on the syntax of the query), or does this already exist? Thanks, Jon... |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-01 12:53:09
|
>What is the status of the SAP dialect? Does it work? I've never actually >tested it myself - I understood it was incomplete. Do the FooBarTests run >on SAP DB? I installed SAP DB + got all the tests running tonight, I needed to make one little change to the dialect to avoid some ugliness. We should document this immediately. Thanks Brad! P.S. It seems that SAP DB has no ANSI-style outerjoins, correct? |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-01 09:53:47
|
If you just need to see the SQL statements executed, you can simply set the property hibernate.show_sql=true. Otherwise: 1. put log4j.jar in your classpath 2. create a log4j.properties file and place it in the classpath. You should configure logging for the category cirrus.hibernate if you want to see all hibernate log messages. Try something like this: log4j.logger.cirrus.hibernate=DEBUG, A #log4j.rootLogger=DEBUG, A log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.File=hibernate.log log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%r [%t] %p %c - %m%n Alternatively, you may configure JDK1.4 logging (if running under JDK1.4). I suppose I should add all this to the documentation. |
From: Damijan S. <dam...@zr...> - 2002-07-01 09:16:23
|
Hi! Is there some easy way to change hibernate log level? (sample properties file etc.) I tried to write simplelog.propertis file but I could not make it work as I wish. Thanx, Damijan |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-01 09:07:01
|
Hi Brad. The html is compiled from the aft files. Aft is an easy-to-use perl program http://www.maplefish.com/todd/aft.html What is the status of the SAP dialect? Does it work? I've never actually tested it myself - I understood it was incomplete. Do the FooBarTests run on SAP DB? > i would like to add the SAP DB dialect to the dialects listed in the > documentation, but am not sure how. the doc directory contains both html > and .aft files (i know nothing about aft). what is the right way to go > about this? |
From: Brad C. <bra...@wo...> - 2002-07-01 08:08:30
|
i would like to add the SAP DB dialect to the dialects listed in the = documentation, but am not sure how. the doc directory contains both = html and .aft files (i know nothing about aft). what is the right way = to go about this? brad |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-06-30 03:47:48
|
Arrived back in AU this morning. From the general inactivity on the list it seems like nobody picked up on any new problems in the latest release which is good news, I suppose ;) |
From: Anton v. S. <an...@ap...> - 2002-06-21 07:43:10
|
The Hibernate rc2 files (.zip and .tar.gz) are now available on the Sourceforge project page. Anton |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-06-21 05:33:08
|
I am spending the next week holidaying in Philippines so won't be paying much attention to the project. Hopefully people will get a chance to try out rc2 at http://geocities.com/footodabar (or at sourceforge if we manage to conquer the technical difficulties involved in getting it there....) Thanks to everyone involved in this the last few weeks :) peace Gavin |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-06-20 00:55:03
|
Actually, stuff $1, $2, etc. One of the things we could do if we had a Query interface would be to allow proper named identifiers. eg. session.prepareQuery("from foo in class Foo where foo.name = $name"); q.setParameter("name", fooName, Hibernate.STRING); q.setMaxResultSize(50); List results = q.getResultList(); Thats really nice, I think.... |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-06-20 00:03:58
|
>> I think theres an interesting issue here in that while certain things are >> more directly and elegantly expressible in Java, others are much easier to >> express in a query language. I have a problem with some persistence >> solutions that reject the idea of embedding query strings in application >> code and try to construct a query through manipulation of objects. >In general, I'm completely in favor of anything that reduces the amount of >code, and expresses something at a higher semantic level, which query >languages usually do (or there'd be no point to them). But I think one >problem with embedding query strings is that languages like Java aren't very >well suited to it, in the absence of some kind of preprocessing (like SQLJ >or JSQL). Not supporting multi-line strings, and having unnamed >placeholders like "?" which are then dependent on sequence to match up with >external parameters, doesn't help matters. hmmm, that was one thing I had been uncertain about. I always hated the anonymous-looking "?" in JDBC. I had considered allowing "$1", "$2" etc in Hibernate queries but this would have been harder to implement and I decided to go for something that would be familiar to people who only use JDBC. We could still add support for $1, $2, etc if we wanted to. It might even be worth the effort.... Implementing this would be a matter of replacing the $N with a ? and then remapping parameter N to the sequential position of ? Not really very hard to do. >The argument I see is that restricting the number of records returned is not >very closely connected semantically to other things expressed in a query, >which primarily relate to the content of the data being queried. Adding >something like this to the query language might be a convenience, but it >doesn't meaningfully affect the expressivity of the query language. From >there, one could argue about keeping custom languages simple and focused, or >something... :) yes, quite so. |
From: Anton v. S. <an...@ap...> - 2002-06-19 22:44:54
|
> Yes, absolutely. I still don't think it is completely misguided to > have the find() and iterate() methods there on the Session I agree, I wasn't dissing Session ;) I do see Session as being a useful aggregation of related functionality. But using Session as a gateway to more sophisticed services makes a lot of sense, and will keep Session from bloating and becoming unmanageable. In fact, I had argued for putting e.g. a commitTransaction() method on Session, but I now think you were correct in nixing that. The right balance is subjective, of course. > I think it makes perfect sense to support both, personally.... Sure. I was really saying that I think the API form is probably easier to implement, opens up some other possibilities, and reduces the need for the language form, so the API should be the higher priority. > I think theres an interesting issue here in that while certain things are > more directly and elegantly expressible in Java, others are much easier to > express in a query language. I have a problem with some persistence > solutions that reject the idea of embedding query strings in application > code and try to construct a query through manipulation of objects. In general, I'm completely in favor of anything that reduces the amount of code, and expresses something at a higher semantic level, which query languages usually do (or there'd be no point to them). But I think one problem with embedding query strings is that languages like Java aren't very well suited to it, in the absence of some kind of preprocessing (like SQLJ or JSQL). Not supporting multi-line strings, and having unnamed placeholders like "?" which are then dependent on sequence to match up with external parameters, doesn't help matters. > I think this particular problem is a borderline case. There is a strong > argument somewhere that borderline cases should be done in Java code for > the sake of compile-time syntax checking, self-documentation, etc..... The argument I see is that restricting the number of records returned is not very closely connected semantically to other things expressed in a query, which primarily relate to the content of the data being queried. Adding something like this to the query language might be a convenience, but it doesn't meaningfully affect the expressivity of the query language. From there, one could argue about keeping custom languages simple and focused, or something... :) I'd have to reverse that conclusion if the language feature became capable of more than simply limiting the total number of returned objects. For example, given GROUP BY functionality, if you could say something like "select first 4 Persons from...group by company", and get a result set containing the first 4 objects in each grouping, that would add expressivity to the query language. The fact that it could also be used to limit the number of objects returned in a simple ungrouped query would merely be a convenient side effect. Anton |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-06-19 22:12:33
|
...is anyone else having service difficulties with sourceforge. I've been trying for two days to do a cvs commit + to upload the latest release. But I'm just getting timeouts from the server. Other sites are no problem. If other people don't have a problem, maybe I need to start hassling Optus. thanks Gavin |