[
https://issues.apache.org/jira/browse/CAY-1492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13036143#comment-13036143
]
K.Krupa Satya Kumari commented on CAY-1492:
-------------------------------------------
//DbAttributeTableModel.java-setAttributeType
public void setAttributeType(String newVal, DbAttribute attr) {
attr.setType(TypesMapping.getSqlTypeByName(newVal));
for (ObjEntity objEntity :
mediator.getCurrentDataMap().getObjEntities()) {
if (objEntity.getDbEntity().equals(mediator.getCurrentDbEntity())) {
objEntity.getAttributeForDbAttribute(attr).setType(
TypesMapping.getJavaBySqlType(attr.getType()));
}
}
}
> Modeler fails migrating from BIGINT to DECIMAL
> ----------------------------------------------
>
> Key: CAY-1492
> URL: https://issues.apache.org/jira/browse/CAY-1492
> Project: Cayenne
> Issue Type: Bug
> Components: Modeler
> Affects Versions: 3.0.1
> Environment: win 7
> Reporter: Borut Bolcina
>
> the 3.0.1 win modeler refuses to migrate some (not all!) changes made in
> mysql database. If I rename column name it works just fine. I changed the
> type from BIGINT to DECIMAL(17,11) and the modeler is showing no operations
> to be performed.
> The database table looks like:
> CREATE TABLE `town` (
> `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
> `mid` int(10) unsigned NOT NULL,
> `name` varchar(60) NOT NULL,
> `label_y` decimal(17,11) unsigned NOT NULL,
> `label_x` decimal(17,11) unsigned NOT NULL,
> PRIMARY KEY (`id`),
> UNIQUE KEY `mid_UNIQUE` (`mid`)
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8
> The curent mapping:
> <db-entity name="town" schema="maps" catalog="maps">
> <db-attribute name="id" type="BIGINT" isPrimaryKey="true"
> isGenerated="true" isMandatory="true" length="10"/>
> <db-attribute name="label_x" type="BIGINT" isMandatory="true"
> length="10"/>
> <db-attribute name="label_y" type="BIGINT" isMandatory="true"
> length="10"/>
> <db-attribute name="mid" type="BIGINT" isMandatory="true"
> length="10"/>
> <db-attribute name="name" type="VARCHAR" isMandatory="true"
> length="60"/>
> </db-entity>
> <obj-entity name="Town" className="com.acme.maps.model.Town"
> dbEntityName="town">
> <obj-attribute name="labelX" type="java.lang.Long"
> db-attribute-path="label_x"/>
> <obj-attribute name="labelY" type="java.lang.Long"
> db-attribute-path="label_y"/>
> <obj-attribute name="name" type="java.lang.String"
> db-attribute-path="name"/>
> </obj-entity>
> I am using mysql connector 5.1.10 on windows 7 and win modeler 3.0.1.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira