[Hibernate] Possible bug in criteria query

2004-10-04 Thread Ugo Cei
Hi people, given that the following query works as expected: List results = session.find("from it.cbim.sipp.model.Allevamento a" + " where a.indirizzo.comune.provincia.sigla = ?", "PG", Hibernate.STRING); I would expect this other query to work as well: Criteria criteria = session

Re: [Hibernate] Commit of pre-alpha Hibernate Metadata annotations (JSR-175)

2004-04-08 Thread Ugo Cei
Gavin King wrote: I disagree. It is an ease-of-use feature. It is just soo much easier when everything is in one place. cross-referencing between mappings and sourcecode is always a pain, especially since my IDE can't help me. Note also that we reduce total LOC, since more info can be inferred f

Re: [Hibernate] Extending Session

2004-02-05 Thread Ugo Cei
Emmanuel wrote: It seems to me that it's not a common case at all Of course it's not that common. If it were, maybe someone else would have solved this problem by now :-). My use case is as follows: I need to add behavior to a Session's save, update, saveOrUpdate methods. As things stand, I can

[Hibernate] Extending Session

2004-01-27 Thread Ugo Cei
;t be better to either turn SessionFactory into an abstract factory, or at least give the option to specify the actual Session class in Hibernate's properties and instantiate it via reflection (not very elegant either, but maybe simpler). What do you think? Ugo -- Ugo Cei

[Hibernate] Extending Session

2003-11-19 Thread Ugo Cei
lution to me, so I'm wondering whether it wouldn't be better to either turn SessionFactory into an abstract factory, or at least give the option to specify the actual Session class in Hibernate's properties and instantiate it via reflection (not very elegant either, but maybe simp

[Hibernate] Mapping a many-to-many relationships with addition attributes.

2003-02-13 Thread Ugo Cei
the fact that I have to manually delete all the Authorships before deleting an Author (and I don't even know HOW!). So, I'm asking if there's anyone who's ever found himself in the same situation, and what is the recommended way to implement this kind of relationship. Th

[Hibernate] NULL values for foreign keys

2003-02-04 Thread Ugo Cei
Is it possible to force fields that are used as a foreign key in a one-to-many relationship to be "NOT NULL"? I don't like the PARENT column of the CHILD table to be nullable. Is this possible using Hibernate 1.2.3? TIA, Ugo ---

Re: [Hibernate] Cursors still open after session.close()

2003-01-21 Thread Ugo Cei
as a bug in my code. If there's someone else using Hibernate under Tomcat (Matt?) or other containers, I'd like to ask whether you're using the container's pooling implementation or Hibernate's and why. Ugo -- Ugo Cei - Consorzio di Bioingegneria e Informatic

[Hibernate] Cursors still open after session.close()

2003-01-21 Thread Ugo Cei
Oracle and not Tomcat's own connection pool via JNDI. Is this behaviour normal? TIA, Ugo -- Ugo Cei - Consorzio di Bioingegneria e Informatica Medica P.le Volontari del Sangue, 2 - 27100 Pavia - Italy Phone: +39.0382.525100 - E-mail: [EMAIL PROTECTED] ---

Re: [Hibernate] Using CLOBs

2003-01-03 Thread Ugo Cei
Gavin King wrote: Ugo, would you please produce a page documenting your approach to this for the Wiki. Other people will also need to know this stuff. Done. I also hope I can find the time to write some reusable code that spares me from having to do all this every single time I want to store a Cl

Re: [Hibernate] Using CLOBs

2003-01-02 Thread Ugo Cei
Gavin King wrote: A the > 4000 characters bit is where you start to need the "for update" clause. We were wondering about that earlier. I think you *could* make it work like this: s = sf.openSession(); tx = s.beginTransaction(); foo = new Foo(); foo.setClob( Hibernate.createClob("") ); s.save(f

Re: [Hibernate] Using CLOBs

2003-01-01 Thread Ugo Cei
.next()) { oracle.sql.CLOB clob = rs.getCLOB(1); java.io.Writer pw = clob.getCharacterOutputStream(); pw.write(content); pw.close(); } - commit If this isn't a PITA, I don't know what is :-( Do you think it's going to be difficult to implement this rigamarole in Hibern

[Hibernate] [1.2.1] Minor glitch in packaging

2002-12-31 Thread Ugo Cei
The hibernate-1.2.1.tar.gz archive unpacks to a directory called hibernate-1.2. Even though it's only a point release, this might casuse some confusion if people inadvertently overwrite the old version. The directory should be called hibernate-1.2.1 (IMHO of course). Ugo -- Ugo Cei -

Re: [Hibernate] Using Oracle Sequence

2002-12-30 Thread Ugo Cei
Raible, Matt wrote: How do I convert the following Oracle query to a hiberate? select ccr_master_sq.nextval from dual; Here's a WAG: ccr_master_sq.nextval dual Is this correct? No, use ccr_master_sq Thanks, Matt You're welcome, U

[Hibernate] Using CLOBs

2002-12-30 Thread Ugo Cei
ture, I'd like to help testing and maybe fixing them, in particular with Oracle, but I need a couple of hints just to get me started. Thanks in Advance, Ugo -- Ugo Cei - http://www.beblogging.com/blog/ --- This sf.net email is spo

RE: [Hibernate] Missing semicolons in generated schema file

2002-12-19 Thread Ugo Cei
f days ago and haven't even downloaded the source, yet. Nice piece of work, BTW. Ugo -- Ugo Cei - http://www.beblogging.com/blog/ --- This SF.NET email is sponsored by: Geek Gift Procrastinating? Get the perfect geek gift now! Before t

[Hibernate] Missing semicolons in generated schema file

2002-12-18 Thread Ugo Cei
OracleDialect --text --output=hib-Oracle.sql --quiet --format --delimiter=';' What happens is that the generated script has the necessary semicolons at the end of "create" statements, but they are completely missing from the end of "drop" statements. Is this a