mybatis / mybatipse

Eclipse plugin adding support for MyBatis SQL Mapper Framework.
Eclipse Public License 1.0
332 stars 91 forks source link

can I use with other file ? #107

Open lotte-medic opened 4 years ago

lotte-medic commented 4 years ago

We use mybatis. but sql file extension is not XML.
We use extension SQLX like a test.sqlx. but Content type is XML file.

Can We use mybatipse plug-in ? Do I have to setting something on Eclipse?

harawata commented 4 years ago

Hello @lotte-medic ,

There might be a good reason, but using a custom extension may make your development difficult. I would recommend using the default extension (i.e. .xml) if that's possible. Even MyBatis itself does not support custom extension, I think.

Anyway, if you really have to use .sqlx, try the following steps:

  1. From 'Eclipse' menu, open 'Preferences...'.
  2. In the left navigation area, choose 'General' > 'Content Types'.
  3. In the 'Content types' list, choose 'Text' > 'XML' > 'MyBatis XML Mapper'.
  4. Click 'Add...' button on the right side of 'File associations' list.
  5. Enter '*.sqlx' and press 'OK' to close the 'Define New Content Type Association' dialog.
  6. Click 'Apply and Close' button to close 'Preferences' dialog.
  7. Re-open the .sqlx file if it is already open.

I just tested and it seems to be working mostly.

Note that there is an open issue #106 which prevents MyBatipse from function properly in the latest version of Eclipse (2020-06).

lotte-medic commented 4 years ago

Thanks for your kindness. ^^ But, It doesn't work. When I re-opend .sqlx file, It works with XML editor. But I clicked with Ctrl+mouse on service java file which is mapper method It doesn't be shown 'Open