[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
17 years, 10 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
17 years, 10 months
[Hibernate-JIRA] Created: (EJB-357) Lazy fetch is ignored with "Linked List" like Entity
by ALan Cheung (JIRA)
Lazy fetch is ignored with "Linked List" like Entity
----------------------------------------------------
Key: EJB-357
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-357
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.3.2.GA
Environment: database: Oracle
Reporter: ALan Cheung
I have an "Linked List" like entity, CustomerVersion, which is defined as follow....
@Entity
@Table (name="CUST_VER")
@SequenceGenerator (name="seqCustVersionId", sequenceName="SEQ_CUST_VER_ID")
public class CustomerVersion {
@Id
@GeneratedValue (generator="seqCustVersionId", strategy=GenerationType.SEQUENCE)
@Column (name="CUST_VER_ID")
private Long versionId;
@Column (name="CUST_AGE")
private Integer age;
@ManyToOne (fetch=FetchType.EAGER)
@JoinColumn (name="CUST_ID", updatable=false, insertable = false)
private Customer master;
@OneToOne (mappedBy = "nextVersion", fetch=FetchType.LAZY, optional=true)
private CustomerVersion previousVersion;
@OneToOne (fetch=FetchType.LAZY, optional=true)
@JoinColumn (name="NEXT_CUST_VER_ID")
private CustomerVersion nextVersion;
@Temporal(TemporalType.DATE)
@Column(name="VER_EFF_DATE")
protected Date versionEffectiveDate;
@Temporal(TemporalType.DATE)
@Column(name="VER_EXPR_DATE")
protected Date versionExpiryDate;
...
...
}
After executing the following, hibernate fetches all the versions once, and issues SQLs to oracle for fetching all the CustomerVersion one by one. This caused a huge performance issue, as we have more than 500 versions.
Criteria criteria = session.createCriteria(CustomerVersion.class);
criteria.createAlias("master", "m")
.add( Restrictions.eq( "m.id", masterPk ) )
.addOrder( Order.asc( "versionEffectiveDate" ) );
criteria.list();
--
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
17 years, 10 months
[Hibernate-JIRA] Created: (HHH-3232) Null Pointer Exception on Sort in a set
by FOIRET (JIRA)
Null Pointer Exception on Sort in a set
---------------------------------------
Key: HHH-3232
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3232
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.0 final
Environment: Windows Apache mySQL Tomcat
Reporter: FOIRET
Priority: Critical
Hi,
Find below a null pointer exception error when i try to find the ElemactionDAO by his ID (vdo.epi.hibernate.ElemactionDAO.findById)
This error appears when i add a sort="natural" in the set of the entity (Action). An Action contains a set of Elemaction
(Find after a part of the mapping file Action)
This parameter resolves my sort issue in the set but it creates this one ...
I use a TreeSet in the POJO Action for the Elemaction
Could you tell me what is the issue ?
java.lang.NullPointerException
at java.lang.String.compareTo(Unknown Source)
at vdo.epi.hibernate.Elemaction.compareTo(Elemaction.java:491)
at java.util.TreeMap.compare(Unknown Source)
at java.util.TreeMap.put(Unknown Source)
at java.util.TreeSet.add(Unknown Source)
at org.hibernate.collection.PersistentSet.initializeFromCache(PersistentSet.java:104)
at org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:35)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:130)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:48)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:755)
at org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:567)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:494)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:356)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:193)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:196)
at org.hibernate.type.TypeFactory.assemble(TypeFactory.java:404)
at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:96)
at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:82)
at org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:540)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:494)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:356)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:193)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
at $Proxy3.get(Unknown Source)
at vdo.epi.hibernate.ElemactionDAO.findById(ElemactionDAO.java:159)
at vdo.epi.page.ActioncreaPage.onEditElem(ActioncreaPage.java:424)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sf.click.util.ClickUtils.invokeListener(ClickUtils.java:1393)
at net.sf.click.control.ActionLink.onProcess(ActionLink.java:498)
at net.sf.click.ClickServlet.processPage(ClickServlet.java:555)
at net.sf.click.ClickServlet.handleRequest(ClickServlet.java:356)
at net.sf.click.ClickServlet.doGet(ClickServlet.java:284)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
Lines in the Mapping file of Action which defines the set of Elemaction
<set name="elemaction" inverse="true" cascade="all" lazy="false" sort="natural">
<cache usage="read-write" />
<key column="actionId" />
<one-to-many class="Elemaction" />
</set>
--
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
17 years, 10 months
[Hibernate-JIRA] Commented: (ANN-161) Add support for custom code-based enums in EnumType - such as mapping ISO codes to gender Enums
by Frederic Leitenberger (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-161?page=co... ]
Frederic Leitenberger commented on ANN-161:
-------------------------------------------
And here my TestEntity. Never mind the BaseEntity, it contains id, version and some additional fields.
You may need to modify the code a little bit to get it working. Or try modifying your own enums to use the MappedEnum-interface.
import javax.persistence.*;
@Entity
public class TestEntity extends BaseEntity {
ExampleEnum color;
@Enumerated
public ExampleEnum getColor() {
return color;
}
public void setColor(ExampleEnum color) {
this.color = color;
}
@Override
public String toString() {
return super.toString() + ", color: " + color;
}
}
> Add support for custom code-based enums in EnumType - such as mapping ISO codes to gender Enums
> -----------------------------------------------------------------------------------------------
>
> Key: ANN-161
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-161
> Project: Hibernate Annotations
> Issue Type: Improvement
> Components: binder
> Affects Versions: 3.1beta6
> Reporter: Leonardo Quijano
> Priority: Minor
> Attachments: MappedEnum.java.patch
>
>
> Now, this could be seen as an improvement to EnumType that's specific to a business domain, but I'm thinking it could help in the general case. Right now we can map JDK enums to several database types, such as INT, VARCHAR, etc. Each of these approaches have some drawbacks, depending on the domain:
> 1) The int mapping is not very reliable through refactorings. An enum that's mapped to a "0" or "2" integer value in the database could end up mapped as a different value if a future refactoring adds an additional enum with an ordinal of 0.
> 2) The varchar mapping could use the enum name instead of its ordinal. But again, if the enum changes, the mapping gets lost and it needs manual changes. It's also heavier on the performance side.
> A useful approach for enum mappings is to use common codes to represent them in the database. That depends of course of the domain logic that's being used. A useful example is the Human sex mapping, defined in ISO code 5218:
> http://en.wikipedia.org/wiki/ISO_5218
> * 0 = not known,
> * 1 = male,
> * 2 = female,
> * 9 = not specified.
> For this to work, the Sex enum could have a property "isoCode" that specifies the mapping between the database integer code and the Java enum.
> For other domain examples additional examples could be specified.
> The EnumType could include a parameter that indicates the property to be evaluated for code-mapping, performing the translation in this way. Of course, reflection cache / byte-code generation / whatever could be specified to speed up the process.
> As always, patches are offered if you think this improvement is viable.
--
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
17 years, 10 months