Return-Path: Delivered-To: apmail-ibatis-dev-archive@www.apache.org Received: (qmail 19193 invoked from network); 25 Mar 2009 18:32:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Mar 2009 18:32:17 -0000 Received: (qmail 12290 invoked by uid 500); 25 Mar 2009 18:32:16 -0000 Delivered-To: apmail-ibatis-dev-archive@ibatis.apache.org Received: (qmail 12269 invoked by uid 500); 25 Mar 2009 18:32:16 -0000 Mailing-List: contact dev-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ibatis.apache.org Delivered-To: mailing list dev@ibatis.apache.org Received: (qmail 12261 invoked by uid 99); 25 Mar 2009 18:32:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Mar 2009 18:32:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Mar 2009 18:32:14 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9C614234C045 for ; Wed, 25 Mar 2009 11:31:53 -0700 (PDT) Message-ID: <341754360.1238005913639.JavaMail.jira@brutus> Date: Wed, 25 Mar 2009 11:31:53 -0700 (PDT) From: "Alisson Gomes Cerqueira (JIRA)" To: dev@ibatis.apache.org Subject: [jira] Created: (IBATIS-590) Generate Model for property MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Generate Model for property ---------------------------- Key: IBATIS-590 URL: https://issues.apache.org/jira/browse/IBATIS-590 Project: iBatis for Java Issue Type: Bug Components: Tools Reporter: Alisson Gomes Cerqueira When generate class java for bean model, by example:
Code generated: public class Person { private Phone phone.id; public Phone getPhone.id() { return phone.id; } public void setPhone.id(Phone phone.id) { return phone.id; } } Solution, create method: public static String getBeanNamePropertyValid(String javaProperty) { String property = javaProperty; if (property != null && !"".equals(property)) { int i = property.indexOf('.'); if (i >= 0) { property = property.substring(0, i); } } return property; } Modified methods: public abstract class BaseModelClassGenerator extends AbstractJavaGenerator { public Field getJavaBeansField(IntrospectedColumn introspectedColumn) { ... String property = StringUtility.getBeanNamePropertyValid(introspectedColumn.getJavaProperty()); ... } public Method getJavaBeansSetter(IntrospectedColumn introspectedColumn) { .... String property = StringUtility.getBeanNamePropertyValid(introspectedColumn.getJavaProperty()); .... } public Method getJavaBeansGetter(IntrospectedColumn introspectedColumn) { ... String property = StringUtility.getBeanNamePropertyValid(introspectedColumn.getJavaProperty()); ... } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.