[hibernate-dev] Dynamic-map and one-to-one relation mapped with intersection table

2013-07-04 Thread Łukasz Antoniak
Hello all, While trying to fix one of Envers issues, I have encountered difficulties inserting one-to-one relation mapped with join table. All audit entities generated by Envers follow EntityMode.MAP pattern. Simple hibernate-core test case - https://gist.github.com/lukasz-antoniak/5929345 - fails

Re: [hibernate-dev] Envers compile issue

2013-04-12 Thread Łukasz Antoniak
Hello Steve, In general Envers does not support formula columns. Probably we should save formula value to audit table. This can be tricky and I have to think it over. Copying formula column to audit entity would not produce expected result in all cases (e.g. time functions used in formula expressi

[hibernate-dev] 'key-many-to-one-element' and 'on-delete'

2013-03-06 Thread Łukasz Antoniak
Hello Team, What do you think about adding "on-delete" attribute to "key-many-to-one-element" type in HBM mapping? This would allow generation of "ON DELETE CASCADE" clause. Context: "HHH-7807 - Deleting Revision Entity" and "HHH-8052 - Possibility to deleted audits/revisions in an orderly way".

[hibernate-dev] Envers 5.0 metamodel branch

2012-11-09 Thread Łukasz Antoniak
Hello Community, Yesterday I have pushed my changes done to apply new metamodel in Envers code: https://github.com/lukasz-antoniak/hibernate-core/tree/envers-metamodel. It's just a working branch so you can see lots of TODO's and code commented out. The task of Envers migration is quite complex

[hibernate-dev] Accessing annotation properties values

2012-10-04 Thread Łukasz Antoniak
Hello Team, In Envers code we use ReflactionManager and XProperty#getAnnotation(Class) quite often. While working on metamodel branch, I have started replacing all those calls with JandexHelper#getValue(AnnotationInstance, String, Class) method. The code became less type safe and grew in size

Re: [hibernate-dev] envers / new metamodel

2012-09-08 Thread Łukasz Antoniak
y > > > > On 7 Sep 2012, at 22:05, Łukasz Antoniak wrote: > >> Hello Steve, >> >> Just wanted to let you know that I am trying to migrate Envers to new >> metamodel. I have asked below question on IRC, but without any >> response. At the m

Re: [hibernate-dev] envers / new metamodel

2012-09-07 Thread Łukasz Antoniak
t will isolate needed changes to just > Envers. Basically the changes at some point will be using the JAXB binding > model rather than DOM. > > > On Fri 24 Aug 2012 01:55:55 AM CDT, Łukasz Antoniak wrote: >> >> Hello Steve, >> >> I think I could start wo

Re: [hibernate-dev] envers / new metamodel

2012-08-23 Thread Łukasz Antoniak
Hello Steve, I think I could start working on metamodel branch at the beginning of September. Is it acceptable for you? I don't want to postpone 4.1.7 release. JIRA task has been already registered: https://hibernate.onjira.com/browse/HHH-7490. Best Regards, Lukasz __ Information fro

Re: [hibernate-dev] HHH-5951 - Guess appropriate JtaPlatform based on environment if an explicit one not specified

2012-08-08 Thread Łukasz Antoniak
.path" ) is only going to work in very > specific environments (and unfortunately often not the environments that you > want to do JTA). > 3) Class path scanning for files like this is assuming the environment is > set up a certain way (worried about something like JBoss's Vir

[hibernate-dev] HHH-5951 - Guess appropriate JtaPlatform based on environment if an explicit one not specified

2012-08-07 Thread Łukasz Antoniak
Hello all, I have implemented basic proof of concept regarding JTA platform recognition. You can find the initial suggestion here: https://github.com/lukasz-antoniak/hibernate-core/commit/3df34efad32ceed98a98d2af2c831119b4261773. Implementation notes: 1) Defining JAR archives in classes extend

Re: [hibernate-dev] SQLServer getLimitString() refactoring

2012-06-14 Thread Łukasz Antoniak
Hello Steve/Guenther, @Steve: Thank you for clear explanation. Will create delegate interface and come back to you. Not sure if it would be backward compatible, have to check that :). > This is because HQL apparently does not support the suppression of the "AS" > keyword for aliases, so this que

Re: [hibernate-dev] SQLServer getLimitString() refactoring

2012-06-13 Thread Łukasz Antoniak
Hello Guenther, I totally agree that user could adapt his query to use "AS" keyword, while we focus on keeping getLimitString() most fast and simple as possible. I think that my modifications are more or less ready and you can view them here: https://github.com/lukasz-antoniak/hibernate-core/

Re: [hibernate-dev] SQLServer getLimitString() refactoring

2012-06-11 Thread Łukasz Antoniak
Hello Guenther, I have discussed with Strong Liu about aliases and it seems that HQL and Criteria API queries always add an alias to selected column or subquery (to @Formula expressions as well). IMO we could assume that aliases are preceded with "AS" keyword. Steve agreed to delegate binding

Re: [hibernate-dev] SQLServer getLimitString() refactoring

2012-06-07 Thread Łukasz Antoniak
Two more notes: 1. Maybe we could select columns without alias by number instead of adding "pageN" alias? Example: "SELECT rid1688_, 2, deviati16_1688_, 4, sortindex1688_ FROM query WHERE __hibernate_row_nr__ >= ? AND __hibernate_row_nr__ < ?". Will have to check if SQL Server supports such syn

Re: [hibernate-dev] SQLServer getLimitString() refactoring

2012-06-07 Thread Łukasz Antoniak
Hello Guenther, The following commit in general describes my thoughts: https://github.com/lukasz-antoniak/hibernate-core/commit/fa8427937f5751170714ec97ac059bee9efd8cff It probably needs some more tuning. Feel free to modify and test. I'm not sure if adding "TOP(100)PERCENT" expression would not

[hibernate-dev] SQLServer getLimitString() refactoring

2012-06-02 Thread Łukasz Antoniak
Hello all, Release 4.1.4 contained few fixes to SQLServer2005Dialect#getLimitString(String, boolean) method. The main JIRA issue (which has links to other related tickets) is HHH-7019. Quincy Leung added recently a comment about moving formula expressions to GROUP BY which causes query to fai

Re: [hibernate-dev] Various "row value construct" alike syntax and Dialect class

2012-05-27 Thread Łukasz Antoniak
uld be more accurate. > Why would the third query fall into > supportsRowValueConstructorSyntaxInInList? Taken into consideration the grow of Dialect class and based on the table posted here: http://lists.jboss.org/pipermail/hibernate-dev/2012-May/008511.html. Steve Ebersole pisze: >

Re: [hibernate-dev] Various "row value construct" alike syntax and Dialect class

2012-05-26 Thread Łukasz Antoniak
One additional note: Where clause| Oracle | PostgreSQL | MySQL -- WHERE (a1, b1) = ( 1, 1 ) | Fail | Pass| Pass -

[hibernate-dev] Various "row value construct" alike syntax and Dialect class

2012-05-25 Thread Łukasz Antoniak
Hello Community, Really quick question. There are quite few SQL syntax tricks similar to "row value construct". CREATE TABLE test ( a1 NUMBER, b1 NUMBER ); SELECT * FROM test WHERE (a1, b1) = ( 1, 1 ); -- Fails on Oracle SELECT * FROM test WHERE (a1, b1) IN ( ( 1, 1 ), ( 2, 2 ) ); -- Passes on O

[hibernate-dev] Multi-table Bulk Operations with Temporary Tables

2012-05-06 Thread Łukasz Antoniak
Hello all! I have just a very short question regarding concurrency aspects when temporary tables are utilized to process multi-table bulk operations. I am trying to refactor part of Envers code which currently executes SELECT FOR UPDATE and UPDATE, to process with a single UPDATE statement. Th

Re: [hibernate-dev] Adding features to Dialect class

2012-04-23 Thread Łukasz Antoniak
We figure out whether data of a single property has changed in SinglePropertyMapper#mapToMapFromEntity(SessionImplementor, Map, Object, Object). So the comparison is based on equals() method. I wanted to change this to: public boolean mapToMapFromEntity(SessionImplementor session, Map data, Obj

Re: [hibernate-dev] Adding features to Dialect class

2012-04-23 Thread Łukasz Antoniak
Totaly agree that expecting null to be equal to empty string in Java model is wrong. IMO he has spotted that when null string reference is replaced with an empty string, Envers creates new revision. From database perspective (Oracle) two records does not differ in any way. This could be actual

Re: [hibernate-dev] [Hibernate-JIRA] Created: (HHH-7187) envers tests fail on other DBs except the default H2

2012-03-22 Thread Łukasz Antoniak
Hello, Tests with ";INIT=CREATE SCHEMA IF NOT EXISTS ENVERS_AUDIT" appended to connection string should for sure run only agains H2. This basically creates second schema for audit tables. Not sure if other RDBMS systems provide similar option. Shall I move this test to src/test/main? There is

Re: [hibernate-dev] Sessions sharing Connections

2012-03-18 Thread Łukasz Antoniak
Hello all, I would also vote for fixing connection sharing issue as soon as possible. If this bug gets resolved, I will fix HHH-7017 in few minutes :). Regards, Lukasz ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org

Re: [hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-20 Thread Łukasz Antoniak
Steve, I have created a JIRA issue (https://hibernate.onjira.com/browse/HHH-7090) and assigned it to you. Why do you think that we should not fix this in the upcoming release? I have also noticed that auto-closing feature of SharedSessionBuilder does not work as documented in JavaDoc. Please s

Re: [hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-17 Thread Łukasz Antoniak
I totally agree with you guys :). However, when I do something like: if (FlushMode.isManualFlushMode(session.getFlushMode())) { Session temporarySession = null; try { temporarySession = ((Session) session).sessionWithOptions().transactionContext()

Re: [hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-13 Thread Łukasz Antoniak
Thanks Steve for such a descriptive replay. I have played a little with SessionBuilder and probably solved the issue. Because of great importance of AuditProcess#doBeforeTransactionCompletion(SessionImplementor) method, please verify my commit: https://github.com/lukasz-antoniak/hibernate-core

[hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-12 Thread Łukasz Antoniak
Hi all, I have a question regarding SessionFactoryImplementor.openTemporarySession() (bug HHH-7017). As observed in non JTA environment with manual flush mode enabled, and 'hibernate.connection.autocommit' disabled, temporary session is not getting committed. How/when should I commit it manual

Re: [hibernate-dev] HHH-6942 - Envers Collection revision entries don't include deletes on detached entity saveOrUpdate

2012-01-28 Thread Łukasz Antoniak
Yes, https://hibernate.onjira.com/browse/HHH-3088 describes the behavior. From the perspective of hibernate-core module this cannot be easily resolved. Fetching related objects would influence performance. But from Envers point of view, we might actually execute a query and produce a warning m

[hibernate-dev] HHH-6942 - Envers Collection revision entries don't include deletes on detached entity saveOrUpdate

2012-01-26 Thread Łukasz Antoniak
Hi all! Lately I have been working on HHH-6942 JIRA issue. Envers behaves differently when detached object is updated with new collection and persisted by invoking Session.merge() or Session.saveOrUpdate() methods. SQL statements executed by Session.merge(): 14:53:47,031 DEBUG SQL:104 - select

[hibernate-dev] HHH-5054 - Add boolean Session.isDirty(Object)

2011-12-05 Thread Łukasz Antoniak
Welcome! Lately I have been trying to add Session.isDirty(Object) method (HHH-5054). Could somebody comment on test case and solution - https://github.com/lukasz-antoniak/hibernate-core/commit/9f39a4a98d34e119f37c90d3953fe083c795bf6a ? IMO adding and removing relations between objects might wo

Re: [hibernate-dev] HHH-1123 - Cannot put more than 1000 elements in a InExpression

2011-11-30 Thread Łukasz Antoniak
Well, I would vote for making things simple, and leaving InExpression as it is. BTW passing more than 1000 elements in IN clause sounds evil :). Regards, Lukasz ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman

[hibernate-dev] HHH-1123 - Cannot put more than 1000 elements in a InExpression

2011-11-29 Thread Łukasz Antoniak
Hi all! Recently I had a closer look at HHH-1123 issue. This bug affects both - Criteria API and HQL. I have introduced Dialect#maximumInExpressionElements() method which returns maximum number of allowed elements in a single SQL IN clause, or null treated as infinite. The change of InExpressi

Re: [hibernate-dev] HHH-2403 - import.sql improvement

2011-11-08 Thread Łukasz Antoniak
Pull request submitted: https://github.com/hibernate/hibernate-core/pull/211 Fill free to comment Steve :). Maybe introducing a new Service is not necessary. Anyway, it can be quickly removed. ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org

Re: [hibernate-dev] HHH-2403 - import.sql improvement

2011-11-07 Thread Łukasz Antoniak
nds(InputStreamReader streamReader); > } > > > We could even supply 2 impls, one for "required semicolon as separator" and > another for "continuation symbol".  And allow users to develop and supply > their own for other situations. > > > On Sun 06

[hibernate-dev] HHH-2403 - import.sql improvement

2011-11-06 Thread Łukasz Antoniak
Welcome! Last time I have been trying to improve the way that Hibernate extracts statements from "import.sql" script. My intention was to support multiline SQL instructions (HHH-2403), quoted strings, multiline comments etc. After developing quite simple ANTLR-based parser, I have realized tha

Re: [hibernate-dev] HHH-6726 LONG and LONG RAW column types in Oracle

2011-10-16 Thread Łukasz Antoniak
)" ); >>> registerColumnType( Types.VARCHAR, "clob" ); >>> >>> Steve, what do you think? Is it too late to make this change for 4.0.0? >>> >>> [1] Table 11-1 of Oracle® Database JDBC Developer's Guide and Reference, >>&

Re: [hibernate-dev] HHH-6726 LONG and LONG RAW column types in Oracle

2011-10-13 Thread Łukasz Antoniak
I have forgotten to mention that Oracle supports LONG to LOB migration. See: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/adlob_long_lob.htm http://download.oracle.com/docs/cd/B10500_01/appdev.920/a96591/adl08lon.htm Regards, Łukasz Antoniak

[hibernate-dev] HHH-6726 LONG and LONG RAW column types in Oracle

2011-10-13 Thread Łukasz Antoniak
Welcome Community! I have just subscribed to the list and wanted to discuss HHH-6726 JIRA issue. Gail Badner wrote (http://lists.jboss.org/pipermail/hibernate-dev/2011-October/007208.html): HHH-6726 (Oracle : map TextType to clob and ImageType to blob) https://hibernate.onjira.com/browse/HHH-67