This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const element = | |
( | |
<h1 className="greeting"> | |
Hello, world! | |
</h1> | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
class App extends Component { | |
render() { | |
return ( | |
<div className="greeting"> | |
<h1> Hello World! </h1> | |
</div> | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map<Object, Object> savedResources = new HashMap<>(); | |
Map<Object, Object> resources = TransactionSynchronizationManager.getResourceMap(); | |
if (resources != null) { | |
for (Map.Entry e : resources.entrySet()) { | |
savedResources.put(e.getKey(), e.getValue()); | |
TransactionSynchronizationManager.unbindResource(e.getKey()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected boolean doReceiveAndExecute(Object invoker, Session session, MessageConsumer consumer, TransactionStatus status) throws JMSException { | |
if (status != null) { | |
TransactionInformation.txnStatus.set(status); | |
} | |
return super.doReceiveAndExecute(invoker, session, consumer, status); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TransactionInformation { | |
public static ThreadLocal<TransactionStatus> txnStatus = new ThreadLocal(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from user in Test.User, | |
join: group in assoc(u, :GROUPS), | |
where: user.'ID' == 6, | |
select: group |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Test.Group do | |
use Test.Web, :model | |
@primary_key {:ID, :id, autogenerate: true} | |
schema "TEST_GROUPS" do | |
field :NAME, :string | |
belongs_to :TENANT, Test.Tenant, foreign_key: :TENANT_ID, references: :ID | |
has_many :PERMISSIONS, Test.Permission, foreign_key: :GROUP_ID, references: :ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Test.Permission do | |
use Test.Web, :model | |
@primary_key {:ID, :id, autogenerate: true} | |
schema "TEST_PERMISSIONS" do | |
field :NAME, :string | |
belongs_to :GROUP, Test.Grup, foreign_key: :GROUP_ID, references: :ID | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Test.User do | |
use Test.Web, :model | |
@primary_key {:ID, :id, autogenerate: true} | |
schema "TEST_USERS" do | |
field :NAME, :string | |
belongs_to :TENANT, Test.Tenant, foreign_key: :TENANT_ID, references: :ID | |
many_to_many :GROUPS, Test.Group, join_through: "TEST_GROUPS_USERS", join_keys: [GROUP_ID: :ID, USER_ID: :ID] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Test.Tenant do | |
use Test.Web, :model | |
@primary_key {:ID, :id, autogenerate: true} | |
schema "TEST_TENANTS" do | |
field :NAME, :string | |
end | |
end |