[Hibernate-JIRA] Created: (HV-389) Support conditional validation at property level
by jason shi (JIRA)
Support conditional validation at property level
------------------------------------------------
Key: HV-389
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-389
Project: Hibernate Validator
Issue Type: New Feature
Components: engine
Affects Versions: 4.1.0.Final
Reporter: jason shi
Assignee: Hardy Ferentschik
In Oval, there is a "when" attribute in each ConstrainsChecker,which can be used for conditional check.
In the following example fieldB must not be null only if fieldA is not null as well. With the prefix groovy: it is indicated that the formula is expressed in the Groovy language.
{code}
public class BusinessObject
{
private String fieldA;
@NotNull(when = "groovy:_this.fieldA != null")
private String fieldB;
}
{code}
Although we can use ScriptAssert as a work-around, but ScriptAssert can't be used at property level validation, and the "when" attribute make the validation logical more clearly.
In UI layer validation, this feature is very important in instant UI validation.
The hibernate validator should have the ability to pass a ValueContext to the Validator,then we can write a custom Contrains to implement this feature.
--
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
13 years, 5 months
[Hibernate-JIRA] Created: (HHH-6546) Properties annotated with ColumnTransformer will force table scans when included in where clauses
by James K (JIRA)
Properties annotated with ColumnTransformer will force table scans when included in where clauses
-------------------------------------------------------------------------------------------------
Key: HHH-6546
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6546
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.5
Environment: Hibernate 3.6.5
MySQL 5.1.52
Reporter: James K
I have a column annotated with a ColumnTransformer as such:
{code}
@ColumnTransformer(read = "AES_DECRYPT(UNHEX(secret), 'password')", write = "HEX(AES_ENCRYPT(?, 'password'))")
private String secret;
{code}
If I use this column in a query then the following where predicate is generated:
{code}
where AES_DECRYPT(UNHEX(webuser0_.secret), 'password')=?
{code}
This where is guaranteed to run a full table scan and execute the decrypt & hex functions on every column.
It would be better if the generated SQL were as follows:
{code}
where webuser0_.secret=HEX(AES_ENCRYPT(?, 'password'))
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[Hibernate-JIRA] Created: (HHH-6545) @Column(columnDefinition = ...) ignored unless placed by get method.
by jee4hire (JIRA)
@Column(columnDefinition = ...) ignored unless placed by get method.
--------------------------------------------------------------------
Key: HHH-6545
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6545
Project: Hibernate Core
Issue Type: Bug
Components: annotations
Environment: Linux omega 2.6.32-33-generic-pae #71-Ubuntu SMP Wed Jul 20 18:46:41 UTC 2011 i686 GNU/Linux
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
jboss-as-7.0.0.Final
mysql-connector-java-5.1.15.jar
mysql-server-5.1 (5.1.41-3ubuntu12.10)
Reporter: jee4hire
>>>Not working: @Column is placed with variable definition.
Column data is created in database as type tinyblob.
Thus, @Column(columnDefinition = "blob") is ignored.
@Entity
public class File implements Serializable {
private Long id;
@NotNull @Column(columnDefinition = "blob")
private byte [] data;
@Id @GeneratedValue
public Long getId() { return id; }
public void setId(Long i) { id = i; }
public byte [] getData() { return data; }
public void setData(byte [] d) { data = d; }
}
##############################################################################
>>>Workaround: @Column is placed with get method.
Then, column data is created in database as type blob.
@Entity
public class File implements Serializable {
private Long id;
private byte [] data;
@Id @GeneratedValue
public Long getId() { return id; }
public void setId(Long i) { id = i; }
@NotNull @Column(columnDefinition = "blob")
public byte [] getData() { return data; }
public void setData(byte [] d) { data = d; }
}
##############################################################################
Excerpt from: jboss-as-7.0.0.Final/standalone/configuration/standalone.xml
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/MySqlDS" pool-name="MySqlDS" enabled="true" jta="true" use-java-context="true" use-ccm="true">
<connection-url>
jdbc:mysql://localhost:3306/jboss
</connection-url>
<driver>
com.mysql
</driver>
<transaction-isolation>
TRANSACTION_READ_COMMITTED
</transaction-isolation>
<pool>
<min-pool-size>
10
</min-pool-size>
<max-pool-size>
100
</max-pool-size>
<prefill>
true
</prefill>
<use-strict-min>
false
</use-strict-min>
<flush-strategy>
FailingConnectionOnly
</flush-strategy>
</pool>
<security>
<user-name>
*************
</user-name>
<password>
*************
</password>
</security>
<statement>
<prepared-statement-cache-size>
32
</prepared-statement-cache-size>
<share-prepared-statements/>
</statement>
</datasource>
<drivers>
<driver name="com.mysql" module="com.mysql">
<xa-datasource-class>
com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
</xa-datasource-class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>
org.h2.jdbcx.JdbcDataSource
</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
##############################################################################
war jars:
61504 Defl:N 56482 8% 2011-07-21 10:31 92d0520b WEB-INF/lib/i18nlog-1.0.10.jar
358085 Defl:N 324832 9% 2011-04-04 11:37 8c574f28 WEB-INF/lib/log4j-1.2.12.jar
47399 Defl:N 41460 13% 2011-07-21 10:31 ac044dbb WEB-INF/lib/jboss-logging-3.0.0.Beta5.jar
204093 Defl:N 181695 11% 2011-07-07 12:54 ed9a2ff2 WEB-INF/lib/picketlink-idm-core-1.5.0.Alpha02.jar
55966 Defl:N 44907 20% 2011-07-07 12:54 d81b0cc2 WEB-INF/lib/seam-international-3.0.0.Final.jar
529064 Defl:N 490198 7% 2011-07-18 14:13 cb9a1aec WEB-INF/lib/quartz-2.0.1.jar
1627515 Defl:N 1470306 10% 2011-07-07 12:54 e71d8ef4 WEB-INF/lib/primefaces-3.0.M2.jar
231287 Defl:N 203688 12% 2011-07-21 10:31 76154858 WEB-INF/lib/jboss-marshalling-1.3.0.CR9.jar
2479225 Defl:N 2249049 9% 2011-08-03 07:41 f775e5eb WEB-INF/lib/richfaces-components-ui-4.1.0-20110802.221239-82.jar
543011 Defl:N 456324 16% 2011-07-12 14:02 f915bdef WEB-INF/lib/joda-time-1.6.1.jar
80863 Defl:N 74890 7% 2011-07-21 10:31 1074f519 WEB-INF/lib/jboss-marshalling-river-1.3.0.CR9.jar
153633 Defl:N 139858 9% 2011-07-18 08:58 267a0105 WEB-INF/lib/seam-security-impl-3.0.1-20110624.041853-12.jar
546379 Defl:N 489412 10% 2011-07-21 10:38 7810d5c7 WEB-INF/lib/jboss-common-core-2.2.17.GA.jar
161455 Defl:N 122304 24% 2011-07-12 15:10 55c0bc93 WEB-INF/lib/knowledge-api-5.2.0.Final.jar
1902276 Defl:N 1719856 10% 2011-07-12 15:10 91eaa4f6 WEB-INF/lib/drools-core-5.2.0.Final.jar
15071 Defl:N 12479 17% 2011-04-04 11:31 a1e02acb WEB-INF/lib/jta-1.1.jar
7635 Defl:N 5428 29% 2011-07-21 10:31 ed71d5ec WEB-INF/lib/rhq-pluginAnnotations-3.0.1.jar
897071 Defl:N 858346 4% 2011-07-12 15:16 a1635c95 WEB-INF/lib/antlr-3.3.jar
91540 Defl:N 81205 11% 2011-07-25 08:27 6d5bdd9e WEB-INF/lib/seam-config-xml-3.0.1-20110723.041850-8.jar
443432 Defl:N 420698 5% 2011-05-16 12:02 d108cdd2 WEB-INF/lib/antlr-2.7.6.jar
1674737 Defl:N 1601274 4% 2011-07-07 12:55 b5de0b5f WEB-INF/lib/ecj-3.5.1.jar
10899 Defl:N 7710 29% 2011-07-21 10:31 b580639d WEB-INF/lib/jboss-transaction-api-1.0.1.GA.jar
15808 Defl:N 12066 24% 2011-07-07 12:54 cbb7cd31 WEB-INF/lib/sac-1.3.jar
269014 Defl:N 245020 9% 2011-06-20 14:42 0d19c92a WEB-INF/lib/commons-net-3.0.1.jar
1472606 Defl:N 1320427 10% 2011-07-21 10:31 0084c472 WEB-INF/lib/infinispan-core-5.0.0.CR7.jar
7457 Defl:N 5972 20% 2011-07-18 14:13 cdac3310 WEB-INF/lib/quartz-jboss-2.0.1.jar
713433 Defl:N 657365 8% 2011-07-12 15:10 3e88a598 WEB-INF/lib/mvel2-2.1.0.drools2.jar
12623 Defl:N 10267 19% 2011-07-21 10:38 77d0c4ba WEB-INF/lib/jboss-logging-spi-2.1.0.GA.jar
253950 Defl:N 241386 5% 2011-05-12 11:27 f758d70e WEB-INF/lib/cssparser-0.9.5.jar
1114265 Defl:N 987976 11% 2011-05-12 11:27 57d773f1 WEB-INF/lib/guava-r08.jar
25496 Defl:N 22183 13% 2011-07-14 12:55 1a95d60b WEB-INF/lib/slf4j-api-1.6.1.jar
85262 Defl:N 64318 25% 2011-08-03 07:41 09f14670 WEB-INF/lib/richfaces-components-api-4.1.0-20110802.221059-82.jar
119223 Defl:N 103690 13% 2011-07-18 08:58 fb1581b3 WEB-INF/lib/seam-persistence-3.0.1-20110711.040751-17.jar
148627 Defl:N 138829 7% 2011-07-12 15:16 3e8b388d WEB-INF/lib/stringtemplate-3.2.1.jar
397907 Defl:N 343667 14% 2011-07-07 12:54 7f34b227 WEB-INF/lib/seam-solder-3.0.0.Final.jar
102661 Defl:N 80043 22% 2011-07-07 12:54 b67dd2a4 WEB-INF/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar
2135793 Defl:N 2028099 5% 2011-07-21 10:31 ade69d61 WEB-INF/lib/jgroups-2.12.0.Final.jar
988489 Defl:N 902079 9% 2011-07-12 15:16 22c8db9d WEB-INF/lib/drools-compiler-5.2.0.Final.jar
424253 Defl:N 391533 8% 2011-08-04 07:24 9a1f5dba WEB-INF/lib/richfaces-core-impl-4.1.0-20110803.165959-73.jar
83291 Defl:N 68465 18% 2011-08-03 07:41 d9920651 WEB-INF/lib/seam-servlet-3.0.1-20110803.040537-7.jar
33716 Defl:N 23689 30% 2011-07-18 08:58 3a591eab WEB-INF/lib/seam-security-api-3.0.1-20110624.041806-12.jar
163650 Defl:N 149460 9% 2011-07-12 15:16 e8acd98f WEB-INF/lib/antlr-runtime-3.3.jar
136498 Defl:N 115026 16% 2011-08-04 07:24 010242c6 WEB-INF/lib/richfaces-core-api-4.1.0-20110803.165751-75.jar
608376 Defl:N 554163 9% 2011-07-14 12:55 4bb8e85b WEB-INF/lib/c3p0-0.9.1.1.jar
23055 Defl:N 14694 36% 2011-07-07 12:54 5dfcdff2 WEB-INF/lib/picketlink-idm-spi-1.5.0.Alpha02.jar
27714 Defl:N 18846 32% 2011-07-07 12:54 9718b1ca WEB-INF/lib/picketlink-idm-api-1.5.0.Alpha02.jar
25717 Defl:N 20670 20% 2011-07-07 12:54 8473b909 WEB-INF/lib/picketlink-idm-common-1.5.0.Alpha02.jar
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[Hibernate-JIRA] Created: (HBX-1081) Generation of meta attributes for composite-id
by Anders Reinhardt Hansen (JIRA)
Generation of meta attributes for composite-id
----------------------------------------------
Key: HBX-1081
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1081
Project: Hibernate Tools
Issue Type: Improvement
Components: reverse-engineer
Affects Versions: 3.2.beta11
Environment: All, not related to platform.
Reporter: Anders Reinhardt Hansen
Priority: Minor
The ReverseEngineeringStrategy has a method; "public Map tableToMetaAttributes(TableIdentifier tableIdentifier)"
This method returns a Map of meta tags which will be put inside the class node of the hbm files that are generated.
It would be a nice addition if we could have a method like this which placed meta tags inside the composite id node.
the method could be called "public Map tableToMetaAttributesForCompositeId(TableIdentifier tableIdentifier)"
An example of the problem is shown in the below example;
<class name="XXX1" table="XXX1">
<meta attribute="generated-class">XXX1Base</meta> <!-- this can be generated by tableToMetaAttributes() -->
<composite-id name="XXX2" class="XXX2">
<meta attribute="generated-class">XXX2Base</meta> <!-- this cannot be generated -->
<key-property name="propertyXXX" type="int">
<column name="ColoumnXXX" />
</key-property>
<key-property name="YYY" type="int">
<column name="ColoumnYYY" />
</key-property>
</composite-id>
...
</class>
The issue was discussed on the forum in topic http://forum.hibernate.org/viewtopic.php?t=989476
--
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
13 years, 5 months