Giter Club home page Giter Club logo

excella-trans's Introduction

Excella Core

  1. ExCella Coreとは

ExCella CoreはExcelファイルをJavaから利用するための共通基盤です。

リファレンス、Javadocは、こちらからご覧いただけます。 http://excella-core.github.io/

ExCella Coreは株式会社ビーブレイクシステムズが 作成したオープンソースソフトウェアです。

  1. 配布条件

本ソフトウェアはApache License, Version 2.0にて公開しています。 詳細は「LICENSE.txt」ファイルまたは 以下のページを参照してください。 https://www.apache.org/licenses/LICENSE-2.0.txt

  1. 免責

このソフトウェアを使用したことによって生じたいかなる 障害・損害・不具合等に関しても、株式会社ビーブレイクシステムズは 一切の責任を負いません。各自の責任においてご使用ください。

  1. Maven repository

mavenの依存ライブラリとして追加する場合、pom.xmlに下記のリポジトリを追加してください。

  <repositories>
    <repository>
	  <id>excella.bbreak.org</id>
      <name>bBreak Systems Excella</name>
      <url>https://excella-core.github.io/maven2/</url>    
    </repository>
  </repositories>
  1. 更新履歴

  • 2023/09/28 Version 2.1 リリース
  • 2019/12/24 Version 2.0 リリース
  • 2019/08/15 Version 1.13 リリース
  • 2017/07/15 Version 1.12 リリース
  • 2017/01/28 Version 1.11 リリース
  • 2016/01/17 Version 1.10 リリース
  • 2015/07/25 Version 1.9 リリース
  • 2014/08/18 Version 1.8 リリース
  • 2013/03/18 Version 1.7 リリース
  • 2010/11/19 Version 1.6 リリース
  • 2010/01/20 Version 1.5 リリース
  • 2009/11/13 Version 1.4 リリース
  • 2009/09/30 Version 1.3 リリース
  • 2009/06/24 Version 1.2 リリース
  • 2009/06/22 Version 1.1 リリース
  • 2009/05/22 Version 1.0 リリース

Copyright 2009 by bBreak Systems.

excella-trans's People

Contributors

daichan20 avatar dependabot[bot] avatar hibi-bb avatar kamisono-bb avatar maruta-bis5 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

excella-trans's Issues

ワークブックを跨いだPoiUtil.copyCellでIllegalArgumentExceptionが発生

PoiUtil内でExceptionが発生しないよう対応するか、
PoiUtilのfinalを外して、継承先で対応できるようにした方が良いと思われます。

参考

ワークブックを跨いでスタイルのコピーは出来ないようです。
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java?view=markup&pathrev=676205#l932

Exception in thread "main" java.lang.IllegalArgumentException: This Style does not belong to the supplied Workbook Stlyes Source. Are you trying to assign a style from one workbook to the cell of a differnt workbook?
    at org.apache.poi.xssf.usermodel.XSSFCellStyle.verifyBelongsToStylesSource(XSSFCellStyle.java:118)
    at org.apache.poi.xssf.usermodel.XSSFCell.setCellStyle(XSSFCell.java:509)
    at org.bbreak.excella.core.util.PoiUtil.copyCell(PoiUtil.java:401)
    at org.bbreak.excella.core.util.PoiUtil.copyRange(PoiUtil.java:527)
    at wakanashi.mavenproject1.App.exe(Main.java:63)
    at wakanashi.mavenproject1.Main.main(Main.java:32)

excella-trans-1.5がexcella-core-2.0に依存しているため使用できない。

excella-transを使用しようとして、pom.xmlに以下の記載をしました。

    <dependencies>
        <dependency>
            <groupId>org.bbreak.excella</groupId>
            <artifactId>excella-trans</artifactId>
            <version>1.5</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>excella.bbreak.org</id>
            <name>bBreak Systems Excella</name>
            <url>http://excella-core.github.io/maven2/</url>
        </repository>
    </repositories>

しかし、mavenでビルドをすると以下のエラーがでました。
Failed to execute goal on project learning-poi: Could not resolve dependencies for project com.wakanashi:learning-poi:jar:1.0-SNAPSHOT: Failure to find org.bbreak.excella:excella-core:jar:2.0 in http://repo.jenkins-ci.org/public/ was cached in the local repository, resolution will not be reattempted until the update interval of repo.jenkins-ci.org has elapsed or updates are forced -> [Help 1]

Tag v1.5のpomにexcella-core-2.0への依存性が記載されていますが、
私の環境からはダウンロードできないようです。
https://github.com/excella-core/excella-trans/blob/v1.5/pom.xml

これは、私の書き方に問題があるのでしょうか?それともtrans-1.5のtagに問題があるのでしょうか?

データ型に応じた、書式や値の制御

GoogleGroupからの転記
https://groups.google.com/forum/#!topic/excella/40g8ucUhKes

(1) 書式が異なる場合は、例外ではなくnullでデータベースに格納したい場合がある
データ挿入(SQL)の定義シートで、データ型を「数値」や「日付」にした場合、書式が異なると
以下のような例外が発生します。

WARN 2010-04-20 09:32:31,560 [main] データ挿入(SQL)処理中に例外が発生しました
Sheet[データ挿入(SQL)] Cell[179,1] Message[値が数値ではありません: ]

WARN 2010-04-20 17:22:10,044 [main] データ挿入(SQL)処理中に例外が発生しました
Sheet[データ挿入(SQL)] Cell[181,1] Message[値が日付ではありません: ]

大半は間違って半角スペースなどが入っていたり、マークとして何らかの文字を入れているケース
ですので、そういったレコードの値は null にしてinsert文を作れると便利です。
勿論例外として処理を終わらせたい時もありますので、定義シート等で指定できるとベストです。

(2) データ型が「文字列」の列に数字が入っている場合の値の制御
例えば、セルに「12345」といった数字のコードを入れていて、これを文字列としてデータベースに
格納したいケースがよくあります。しかし、これをそのまま実行すると、

insert into company (company_code) values ('12345.0');

のように、insert文のvalueに「.0」が付与されてしまいます。
(セルの書式を文字列にしても「.0」が付与されます。)

さすがに頭に「'」を付けていくのは面倒ですので、今のところはExcelの「データ」⇒「区切り位> 置」で
列のデータ形式を文字列に設定することで回避しています。
ただ、データ型を「文字列」に指定しているので、わざわざそういった調整をしなくても済めば良いと思います。
これはExcel側の問題かもしれませんが、可能でしたら ExCella Trans 側で対応できると助かります。

(3) データ型が「文字列」の列に「'」が入っている場合、自動で「''」に変換
海外の社名などが移行対象の場合、「'」(半角のシングルクォート)が時々出てきます。
当然そのまま ExCella Trans でinsert文を作ったらエラーになりますので、手で「''」のようにエスケープ
することで回避しています。
しかし、この作業は結構手間がかかるので、定義シート等で指定した列については自動で変換、といった
機能があると便利です。

Improve code quality

コード品質向上のため、SonarQubeの使用を開始しました。
多数の指摘が上がっているため順次修正していきます。
https://sonarcloud.io/project/issues?id=excella-core_excella-trans&resolved=false

Feel free to fix and provide PR!

修正時のお願い

  • 1種類の指摘に対する修正を1つのPull Requestとしてください。
    • 例: 指摘1指摘2はいずれもルールThe diamond operator ("<>") should be usedによる指摘であるため、1つのPRでまとめて修正してOK
    • 例: 指摘1指摘3は別のルールによる指摘のため、別PRとする
  • 同じルールによる指摘をすべて網羅していなくてもOKです(1ファイルだけ修正する、等)が、同じ指摘がファイル中にあればすべて修正してください。
  • 修正しなくても問題なさそうな指摘があれば、このIssueで教えてください。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.