Author: vyemialyanchyk
Date: 2009-04-17 13:54:50 -0400 (Fri, 17 Apr 2009)
New Revision: 14811
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
Log:
JBIDE-3842 - @Column.length - setup non default string length functionality - update for
getters
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2009-04-17
17:51:37 UTC (rev 14810)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2009-04-17
17:54:50 UTC (rev 14811)
@@ -422,12 +422,12 @@
if ("java.lang.String".equals(typeName) ||
"String".equals(typeName)) { //$NON-NLS-1$ //$NON-NLS-2$
String fieldId = returnIdentifier;
RefColumnInfo rci = entityInfo.getRefColumnInfo(fieldId);
- if (rci == null) {
+ if (rci == null || !rci.isExist()) {
// if there is no @Column annotation - create new @Column annotation
// with user defined default value length
NormalAnnotation natd = rewriter.getAST().newNormalAnnotation();
natd.setTypeName(rewriter.getAST().newSimpleName(JPAConst.ANNOTATION_COLUMN));
- ListRewrite lrw = rewriter.getListRewrite(node,
FieldDeclaration.MODIFIERS2_PROPERTY);
+ ListRewrite lrw = rewriter.getListRewrite(node,
MethodDeclaration.MODIFIERS2_PROPERTY);
lrw.insertFirst(natd, null);
MemberValuePair mvp = rewriter.getAST().newMemberValuePair();
mvp.setName(rewriter.getAST().newSimpleName("length")); //$NON-NLS-1$