Skip to content

Instantly share code, notes, and snippets.

@firatkarakusoglu
Forked from sebnmuller/db-data-config
Created February 11, 2016 09:22
Show Gist options
  • Select an option

  • Save firatkarakusoglu/613a7c1dc9cecb090e26 to your computer and use it in GitHub Desktop.

Select an option

Save firatkarakusoglu/613a7c1dc9cecb090e26 to your computer and use it in GitHub Desktop.

Revisions

  1. @sebnmuller sebnmuller renamed this gist Apr 30, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @sebnmuller sebnmuller revised this gist Apr 30, 2015. 1 changed file with 34 additions and 0 deletions.
    34 changes: 34 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    <dataConfig>
    <dataSource type="JdbcDataSource"
    driver="com.mysql.jdbc.Driver"
    name="employees_db"
    url="jdbc:mysql://localhost:3306/employees"
    user="user"/>
    <dataSource type="JdbcDataSource"
    driver="com.mysql.jdbc.Driver"
    name="posten_db"
    url="jdbc:mysql://localhost:3306/kawdbprod1"
    user="user"
    password="password"/>
    <document>
    <entity name="employees"
    dataSource="employees_db"
    query="select e.emp_no as 'id', e.birth_date,
    (
    select t.title
    order by t.from_date desc
    limit 1
    ) as 'title_s', e.first_name, e.last_name, e.gender as 'gender_s', d.dept_name as 'dept_s', 'employees' as 'source_s'
    from employees e
    join dept_emp de on de.emp_no = e.emp_no
    join departments d on d.dept_no = de.dept_no
    join titles t on t.emp_no = e.emp_no
    group by e.emp_no
    limit 1000;" />
    <entity name="posten"
    dataSource="posten_db"
    query="select product_id as 'id', title as 'product_s', 'posten' as 'source_s'
    from kaw_produkt_valid_index limit 100;"
    />
    </document>
    </dataConfig>
  3. @sebnmuller sebnmuller revised this gist Apr 13, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion db-data-config2
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    select e.emp_no, e.birth_date,
    select e.emp_no as 'id', e.birth_date,
    (
    select t.title
    order by t.`from_date` desc
  4. @sebnmuller sebnmuller revised this gist Apr 13, 2015. 1 changed file with 4 additions and 12 deletions.
    16 changes: 4 additions & 12 deletions db-data-config2
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,13 @@
    <dataConfig>
    <dataSource type="JdbcDataSource"
    driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/employees"
    user="user"
    password="password" />
    <document>
    <entity name="id" query="select e.emp_no, e.birth_date,
    select e.emp_no, e.birth_date,
    (
    select t.title
    order by t.`from_date` desc
    limit 1
    ) as 'title_s', e.first_name, e.last_name, e.gender, d.`dept_name` as 'dept_s'
    ) as 'title_s', e.first_name, e.last_name, e.gender as 'gender_s', d.`dept_name` as 'dept_s'
    from employees e
    join dept_emp de on de.`emp_no` = e.`emp_no`
    join departments d on d.`dept_no` = de.`dept_no`
    join titles t on t.`emp_no` = e.`emp_no`
    group by `emp_no`
    limit 1000;" />
    </document>
    </dataConfig>
    limit 1000;

  5. @sebnmuller sebnmuller revised this gist Apr 13, 2015. 1 changed file with 21 additions and 0 deletions.
    21 changes: 21 additions & 0 deletions db-data-config2
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    <dataConfig>
    <dataSource type="JdbcDataSource"
    driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/employees"
    user="user"
    password="password" />
    <document>
    <entity name="id" query="select e.emp_no, e.birth_date,
    (
    select t.title
    order by t.`from_date` desc
    limit 1
    ) as 'title_s', e.first_name, e.last_name, e.gender, d.`dept_name` as 'dept_s'
    from employees e
    join dept_emp de on de.`emp_no` = e.`emp_no`
    join departments d on d.`dept_no` = de.`dept_no`
    join titles t on t.`emp_no` = e.`emp_no`
    group by `emp_no`
    limit 1000;" />
    </document>
    </dataConfig>
  6. @sebnmuller sebnmuller revised this gist Aug 28, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion db-data-config
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,6 @@
    user="user"
    password="password" />
    <document>
    <entity name="id" query="select emp_no as 'id', first_name, last_name from employees;" />
    <entity name="id" query="select emp_no as 'id', first_name, last_name from employees limit 1000;" />
    </document>
    </dataConfig>
  7. @sebnmuller sebnmuller revised this gist Aug 28, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions db-data-config
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@
    <dataSource type="JdbcDataSource"
    driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/employees"
    user="root"
    password="0104engelberg" />
    user="user"
    password="password" />
    <document>
    <entity name="id" query="select emp_no as 'id', first_name, last_name from employees;" />
    </document>
  8. @sebnmuller sebnmuller created this gist Aug 28, 2014.
    10 changes: 10 additions & 0 deletions db-data-config
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <dataConfig>
    <dataSource type="JdbcDataSource"
    driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/employees"
    user="root"
    password="0104engelberg" />
    <document>
    <entity name="id" query="select emp_no as 'id', first_name, last_name from employees;" />
    </document>
    </dataConfig>