[Hibernate-JIRA] Resolved: (ANN-343) validator messages in brazilian portuguese
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-343?page=all ]
Emmanuel Bernard resolved ANN-343:
----------------------------------
Fix Version: 3.2.0
Resolution: Fixed
Assign To: Emmanuel Bernard
Thanks!
> validator messages in brazilian portuguese
> ------------------------------------------
>
> Key: ANN-343
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-343
> Project: Hibernate Annotations
> Type: Improvement
> Components: validator
> Versions: 3.2.0.cr1
> Reporter: Guilherme de Azevedo Silveira
> Assignee: Emmanuel Bernard
> Fix For: 3.2.0
>
> Original Estimate: 2 minutes
> Remaining: 2 minutes
>
> Here is the translation.
> The file should be named after brazilian portugues (pt-br).
> validator.assertFalse=asserção falhou
> validator.assertTrue=asserção falhou
> validator.future=deve ser uma data no futuro
> validator.length=tamanho deve estar entre {min} e {max}
> validator.max=deve ser menor ou igual a {value}
> validator.min=deve ser maior ou igual a {value}
> validator.notNull=não pode ser nulo
> validator.past=deve ser uma data no passado
> validator.pattern=deve ser válida de acordo com a expressão "{regex}"
> validator.range=deve estar entre {min} e {max}
> validator.size=tamanho deve estar entre {min} e {max}
> validator.email=não é um email válido
--
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
18 years, 5 months
[Hibernate-JIRA] Updated: (HHH-511) reattach object from same session
by Rodrigo S. de Castro (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-511?page=all ]
Rodrigo S. de Castro updated HHH-511:
-------------------------------------
Attachment: reattach-same-session.patch
Patch against Hibernate 3.1.3
Apply it with: patch -p1 -i ./reattach-same-session.patch
I developed this patch to fix two problems I faced when reattaching objects to the session after clearing it:
- "reassociated object has dirty collection reference"
- "Found two representations of same collection: (collection type)"
This patch fixes this problem by allowing an object from a given session to be reattached. To do that, there are two minor changes in two classes:
- OnLockVisitor: in processCollection(), when a collection has been attached to the same session, we only throw an exception if the collection is dirty, otherwise we reattach this collection to the session and move on.
- Collections: in processReachableCollection() method, when a given collection is not found in the session persistence context, we check if it is a collection that has been previously attached to the session. If it is, we add this collection back to the persistence context. That fixes "Found two representations..." problem.
This code was tested and works just fine for me, fixing the problems I was facing. I hope this patch helps to solve the problems mentioned above.
PLEASE, check if this is the correct solution and review this code, in this case. I am not an expert in hibernate source code, so maybe there are other scenarios that reattaching objects is not allowed.
- Background
Some background of why I needed this problem fixed. Basically, I have a web application (spring mvc + hibernate) and wanted to develop JUnit tests for it. Using AbstractTransactionalSpringContextTests Spring class, each method is transactional, rolling back after its completion as a default behavior.
However, my goal was simulate several requests in a given method, ie, within a transaction (which happens to be per method). For that, everything would be perfect if I could clear hibernate session, in order to test the scenario where I have LazyInitializationException and similar problems:
public void testMethod1()
throws Exception {
// request1
request = new MockHttpServletRequest();
getCurrentSession().clear();
// .. request code ...
// request2
request = new MockHttpServletRequest();
getCurrentSession().clear();
// requestN
request = new MockHttpServletRequest();
getCurrentSession().clear();
}
But I had to implement thousands of workaround to avoid the problems mentioned above, what is impossible to maintain in the long run.
> reattach object from same session
> ---------------------------------
>
> Key: HHH-511
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-511
> Project: Hibernate3
> Type: Bug
> Components: core
> Reporter: Gavin King
> Priority: Minor
> Attachments: reattach-same-session.patch
>
>
> http://forum.hibernate.org/viewtopic.php?p=2231400#2231400
> There is a problem when you reattach a collection to the same session that it was previously attached to, after calling clear(). Hibernate checks the collections session reference, at reattach and concludes it is already attached.
--
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
18 years, 5 months
[Hibernate-JIRA] Updated: (HBX-713) hbm2java task: meta support needed for class level annotations
by Daniel Pocock (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-713?page=all ]
Daniel Pocock updated HBX-713:
------------------------------
Attachment: class-annotations.patch
This patch provides support for class level annotations, this is a usage example:
<meta attribute="class-annotation">@Name("myBean")</meta>
<meta attribute="class-annotation">@Scope(SESSION)</meta>
> hbm2java task: meta support needed for class level annotations
> --------------------------------------------------------------
>
> Key: HBX-713
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-713
> Project: Hibernate Tools
> Type: Bug
> Components: hbm2java
> Versions: 3.2beta6
> Environment: hibernate tools 3.2 beta 6
> JBoss 4.0.4.GA with EJB3
> Reporter: Daniel Pocock
> Attachments: class-annotations.patch
>
> Original Estimate: 1 hour
> Remaining: 1 hour
>
> We use hbm2java to create EJB3 entity beans from hbm files. It would be really useful to use the `meta' element to insert additional class level annotations. Is someone already working on such a feature, or should I submit a patch?
> Here is an example of what I would like to do:
> <meta attribute="extra-import">org.jboss.seam.annotations.Name</meta>
> <meta attributre="class-annotation">@Name("myObject")</meta>
> such that the following code would be generated:
> import javax.ejb.Entity;
> import org.jboss.seam.annotations.Name;
> @Entity
> @Name("myObject")
> public class MyObject ....
--
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
18 years, 5 months
[Hibernate-JIRA] Commented: (HBX-713) hbm2java task: meta support needed for class level annotations
by Daniel Pocock (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-713?page=co... ]
Daniel Pocock commented on HBX-713:
-----------------------------------
I've written a patch for this, but unable to compile Hibernate tools:
a) build.sh mentions ../hibernate-3.1, should be ../hibernate-3.2
b) The following errors are reported by the compiler, using version 10233 from SVN:
[javac] /home/daniel/ws/hibernate/HibernateExt/ejb/src/java/org/hibernate/ejb/AbstractEntityManagerImpl.java:584: cannot find symbol
[javac] symbol : constructor OptimisticLockException(<nulltype>,org.hibernate.HibernateException,java.lang.Object)
[javac] location: class javax.persistence.OptimisticLockException
[javac] throwPersistenceException( new OptimisticLockException( null, e, entity ) );
[javac] ^
[javac] /home/daniel/ws/hibernate/HibernateExt/ejb/src/java/org/hibernate/ejb/instrument/InterceptFieldClassFileTransformer.java:23: cannot find symbol
[javac] symbol : method getEntityClassTransformer(<nulltype>,java.lang.String[])
[javac] location: interface org.hibernate.bytecode.BytecodeProvider
[javac] classTransformer = Environment.getBytecodeProvider().getEntityClassTransformer(
[javac] ^
[javac] 2 errors
> hbm2java task: meta support needed for class level annotations
> --------------------------------------------------------------
>
> Key: HBX-713
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-713
> Project: Hibernate Tools
> Type: Bug
> Components: hbm2java
> Versions: 3.2beta6
> Environment: hibernate tools 3.2 beta 6
> JBoss 4.0.4.GA with EJB3
> Reporter: Daniel Pocock
>
> Original Estimate: 1 hour
> Remaining: 1 hour
>
> We use hbm2java to create EJB3 entity beans from hbm files. It would be really useful to use the `meta' element to insert additional class level annotations. Is someone already working on such a feature, or should I submit a patch?
> Here is an example of what I would like to do:
> <meta attribute="extra-import">org.jboss.seam.annotations.Name</meta>
> <meta attributre="class-annotation">@Name("myObject")</meta>
> such that the following code would be generated:
> import javax.ejb.Entity;
> import org.jboss.seam.annotations.Name;
> @Entity
> @Name("myObject")
> public class MyObject ....
--
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
18 years, 5 months