Skip to content

Instantly share code, notes, and snippets.

View sajithdilshan's full-sized avatar

Sajith Edirisinghe sajithdilshan

View GitHub Profile
id hours restarts minor_repairs major_repairs extra_cost
1 10 0 0 0 0
2 8 1 2 0 100
3 15 3 0 1 1000
4 12 3 5 0 800
id hours restarts minor_repairs major_repairs extra_cost
1 12 0 0 0 0
2 12 2 1 0 100
5 12 0 0 0 0
import org.adroitlogic.x.annotation.config.Parameter;
import org.adroitlogic.x.api.config.InputType;
import org.adroitlogic.x.api.template.ResourceTemplate;
import org.adroitlogic.x.api.template.XResourceTemplate;
import java.util.UUID;
@ResourceTemplate(displayName = "ActiveMQ JMS")
public class ActiveMQJmsConfiguration implements XResourceTemplate {
defmodule Test.Repo.Migrations.SampleMigration do
use Ecto.Migration
def change do
create table(:TEST_TENANTS, primary_key: false) do
add :ID, :serial, primary_key: true
add :NAME, :string
end
defmodule Test.Tenant do
use Test.Web, :model
@primary_key {:ID, :id, autogenerate: true}
schema "TEST_TENANTS" do
field :NAME, :string
end
end
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]
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
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
from user in Test.User,
join: group in assoc(u, :GROUPS),
where: user.'ID' == 6,
select: group
public class TransactionInformation {
public static ThreadLocal<TransactionStatus> txnStatus = new ThreadLocal();
}