[Hibernate-JIRA] Created: (HV-36) DefaultValidatorMessages_ja.properties
by WATANABE Takashi (JIRA)
DefaultValidatorMessages_ja.properties
--------------------------------------
Key: HV-36
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-36
Project: Hibernate Validator
Issue Type: Patch
Reporter: WATANABE Takashi
Priority: Trivial
Attachments: 20070705_2145.patch.txt, 20070705_2145.sample.DefaultValidatorMessages_ja.png
http://anonsvn.jboss.org/repos/hibernate/trunk/HibernateExt/validator/src...
I'm not a professional translator, and turned to translators
of the JJBug(Japan JBoss User Group; www.jbug.jp).
http://lists.sourceforge.jp/mailman/archives/japan-jbug-translators/2007-...
Mr. Kimura gave me some good advice there, and (I believe)
I managed to translate it into Japanese that is not only
straightforward, but also respectful of the original text.
I assumed the messages of assertFalse, assertTrue, notNull,
notEmpty, and pattern were meant for programmers rather than
end users because of the existence of words such as "assertion",
"null", and "regex(and match)".
I hope that's useful.
--
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
16 years, 5 months
[Hibernate-JIRA] Created: (HV-14) Minor typo in regular expression in class EmailValidator
by Talal Al-Tamimi (JIRA)
Minor typo in regular expression in class EmailValidator
--------------------------------------------------------
Key: HV-14
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-14
Project: Hibernate Validator
Issue Type: Bug
Components: validators
Affects Versions: 3.0.0.ga
Reporter: Talal Al-Tamimi
Priority: Trivial
It looks like there is a small mistake in the regular expression below from class EmailValidator:
private static String ATOM = "[^\\x00-\\x1F^\\(^\\)^\\<^\\>^\\@^\\,^\\(;^\\:^\\\\^\\\"^\\.^\\[^\\]^\\s]";
The substring to exclude a semicolon should be "^\\;" but above it is shown as "^\\(;"
Instead of excluding a semicolon, this will exclude the left parenthesis (which is already done earlier in the regular expression) and allow a semicolon.
Also, the initialize method is instantiating instance variable 'pattern' twice. The first seems to be an older line of code, so it might be a good idea to comment it out. This is not a bug though, since the first instance is just discarded.
--
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
16 years, 5 months
[Hibernate-JIRA] Created: (EJB-278) Missing sequence or table on Oracle
by André Fernandes (JIRA)
Missing sequence or table on Oracle
-----------------------------------
Key: EJB-278
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-278
Project: Hibernate Entity Manager
Type: Patch
Components: EntityManager
Environment: JBoss 4.0.5.GA, Using JBoss SEAM and Oracle 9i, EJB/JPA annotations
Reporter: André Fernandes
Here we use a user "project_web" to access a "dbproject" schema.
The problem is, when Hibernate looks for the sequences, it looks in the user_sequences, but my user (project_web) don't have any sequences.
The solving is: when getting the sequence names (org.hibernate.dialect.Oracle9Dialect .getQuerySequencesString) use that:
select SEQUENCE_NAME from all_sequences where SEQUENCE_OWNER='DBPROJECT'
i.e. use the schema to look in the all_sequences.
Sorry for the bad english.
package org.hibernate.dialect;
public class Oracle9Dialect extends Dialect {
public String getQuerySequencesString() {
return "select sequence_name from user_sequences";
}
@GeneratedValue(generator="sqCoSeqProjeto", strategy=GenerationType.SEQUENCE)
@SequenceGenerator(name="sqCoSeqProjeto", sequenceName="sq_coseqprojeto", allocationSize=5)
--
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
16 years, 6 months
[Hibernate-JIRA] Created: (HHH-2382) DefaultLoadEventListener#onLoad throws exception when DelayedPostInsertIdentifier is set as an entity id
by Eelco Hillenius (JIRA)
DefaultLoadEventListener#onLoad throws exception when DelayedPostInsertIdentifier is set as an entity id
--------------------------------------------------------------------------------------------------------
Key: HHH-2382
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2382
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.1, 3.2.2, 3.2.0.ga
Reporter: Eelco Hillenius
DefaultLoadEventListener#onLoad has this code:
if ( idClass != null && ! idClass.isInstance( event.getEntityId() ) ) {
throw new TypeMismatchException(
"Provided id of the wrong type. Expected: " + idClass + ", got " + event.getEntityId().getClass());
}
However, EntityIdentityInsertAction has this in it's constructor:
delayedEntityKey = isDelayed ? generateDelayedEntityKey() : null;
and method:
private synchronized EntityKey generateDelayedEntityKey() {
if ( !isDelayed ) {
throw new AssertionFailure( "cannot request delayed entity-key for non-delayed post-insert-id generation" );
}
return new EntityKey( new DelayedPostInsertIdentifier(), getPersister(), getSession().getEntityMode() );
}
In case an insert is tried outside of an existing transaction users may run into this problem (like I did).
I don't know what the best fix is. The easiest fix would be:
Index: /Users/eelcohillenius/Documents/workspace/hibernate3/src/org/hibernate/event/def/DefaultLoadEventListener.java
===================================================================
--- /Users/eelcohillenius/Documents/workspace/hibernate3/src/org/hibernate/event/def/DefaultLoadEventListener.java (revision 11098)
+++ /Users/eelcohillenius/Documents/workspace/hibernate3/src/org/hibernate/event/def/DefaultLoadEventListener.java (working copy)
@@ -5,6 +5,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.LockMode;
import org.hibernate.NonUniqueObjectException;
@@ -10,7 +11,7 @@
import org.hibernate.NonUniqueObjectException;
import org.hibernate.PersistentObjectException;
import org.hibernate.TypeMismatchException;
-import org.hibernate.EntityMode;
+import org.hibernate.action.DelayedPostInsertIdentifier;
import org.hibernate.cache.CacheConcurrencyStrategy;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.entry.CacheEntry;
@@ -82,7 +83,7 @@
}
else {
Class idClass = persister.getIdentifierType().getReturnedClass();
- if ( idClass != null && ! idClass.isInstance( event.getEntityId() ) ) {
+ if ( idClass != null && ! (idClass.isInstance( event.getEntityId() ) || event.getEntityId() instanceof DelayedPostInsertIdentifier )) {
throw new TypeMismatchException(
"Provided id of the wrong type. Expected: " + idClass + ", got " + event.getEntityId().getClass()
);
but that would look like a quick hack to me.
--
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
16 years, 6 months
[Hibernate-JIRA] Created: (ANN-676) Composite PK/FK and the alphabetical order of class names
by Immo Heikkinen (JIRA)
Composite PK/FK and the alphabetical order of class names
---------------------------------------------------------
Key: ANN-676
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-676
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.3.0.ga
Environment: Hibernate Core 3.2.5.GA , Hibernate Annotations 3.3.0.GA, Sybase ASE 15
Reporter: Immo Heikkinen
Priority: Blocker
Attachments: TestCaseFailure.zip, TestCaseOK.zip
Original discussion on the user forum: http://forum.hibernate.org/viewtopic.php?t=980623
I am having trouble with composite primary/foreign keys and sequence of classes with bidirectional one-to-many relationship between them. I am getting strange annotation exception with annotations that seem to be perfectly ok.
My conclusion is that the name of classes need to be in alphabetical order, otherwise misleading exception about the number of columns is thrown.
Attachment TestCaseOK.zip contains sequence of three entity classes A, B and C, with bi-directional one-to-many association between them. This mapping works fine.
Attachment TestCaseFailure.zip contains the same classes, but B and C has been changed with each other (B has been renamed to C, and C has been renamed to B.) This mapping causes the following AnnotationException:
Caused by: org.hibernate.AnnotationException: A Foreign key refering C from B has the wrong number of column. should be 1
The reason for this seems to be the alphabetical order of the class names! Sequence A --> B --> C is fine but A --> C --> B is not.
If you use @Table to define the database table names, it is the table names that need to be in alphabetical order.
The same error can be also produced with @SecondaryTable in class/table that has composite PK. This case is more difficult since you cannot get rid of the exception, no matter how you name your classes or tables. I believe this is the same bug that appears in the comments of ANN-509 .
--
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
16 years, 6 months