Search in sources :

Example 1 with User

use of com.github.yukihane.hibernateissues.qiita20180224.entity.User in project hello-java by yukihane.

the class Qiita20180224ApplicationTests method contextLoads.

@Test
public void contextLoads() {
    User user = new User();
    user.setUserNo("no_01");
    Order order = new Order();
    User savedUser = repository.save(user);
    savedUser.setOrders(Arrays.asList(order));
}
Also used : Order(com.github.yukihane.hibernateissues.qiita20180224.entity.Order) User(com.github.yukihane.hibernateissues.qiita20180224.entity.User) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test)

Example 2 with User

use of com.github.yukihane.hibernateissues.qiita20180224.entity.User in project jpa by xnat9.

the class JpaTest method testHqlRows2.

@Test
void testHqlRows2() {
    try (Repo repo = new Repo("jdbc:mysql://localhost:3306/mysql?useSSL=false&user=root&password=root&allowPublicKeyRetrieval=true").entities(User.class).init()) {
        List<Map> records = repo.hqlRows("select new map(Host as host,User as user) from User where User=:user", Map.class, "root");
        log.info(records.toString());
    }
}
Also used : User(entity.User) Repo(cn.xnatural.jpa.Repo) Test(org.junit.jupiter.api.Test)

Example 3 with User

use of com.github.yukihane.hibernateissues.qiita20180224.entity.User in project jpa by xnat9.

the class JpaTest method testHqlFirstRow3.

@Test
void testHqlFirstRow3() {
    try (Repo repo = new Repo("jdbc:mysql://localhost:3306/mysql?useSSL=false&user=root&password=root&allowPublicKeyRetrieval=true").entities(User.class).init()) {
        User user = repo.hqlRow("select new entity.User(Host,User) from User where User=:user", User.class, "root");
        log.info(user == null ? "" : user.toString());
    }
}
Also used : User(entity.User) Repo(cn.xnatural.jpa.Repo) Test(org.junit.jupiter.api.Test)

Example 4 with User

use of com.github.yukihane.hibernateissues.qiita20180224.entity.User in project jmix-docs by Haulmont.

the class SendEmailJavaDelegate method execute.

@Override
public void execute(DelegateExecution execution) {
    // <2>
    // <3>
    User addresseeValue = (User) addressee.getValue(execution);
    String emailSubjectValue = (String) emailSubject.getValue(execution);
    String emailBodyValue = (String) emailBody.getValue(execution);
    EmailInfo emailInfo = // <4>
    EmailInfoBuilder.create().setAddresses(addresseeValue.getEmail()).setSubject(emailSubjectValue).setFrom(null).setBody(emailBodyValue).build();
    // <5>
    emailer.sendEmailAsync(emailInfo);
}
Also used : User(bpm.ex1.entity.User) EmailInfo(io.jmix.email.EmailInfo)

Example 5 with User

use of com.github.yukihane.hibernateissues.qiita20180224.entity.User in project jmix-docs by Haulmont.

the class TaskAssignedNotificationSender method onOtherProcessTaskAssigned.

// end::event-listener-1[]
// tag::specific-process-1[]
@EventListener
protected void onOtherProcessTaskAssigned(UserTaskAssignedEvent event) {
    if ("order-approval".equals(event.getProcessDefinition().getKey())) {
        // ...
        // end::specific-process-1[]
        User user = dataManager.load(User.class).query("select u from smpl_User u where u.username = " + ":username").parameter("username", event.getUsername()).one();
        Task task = event.getTask();
        String emailTitle = "New process task " + task.getName();
        String emailBody = "Hi " + user.getFirstName() + "\n" + "The task" + task.getName() + "has been assigned.";
        EmailInfo emailInfo = EmailInfoBuilder.create().setAddresses(user.getEmail()).setSubject(emailTitle).setFrom(null).setBody(emailBody).build();
        emailer.sendEmailAsync(emailInfo);
    // tag::specific-process-2[]
    }
}
Also used : Task(org.flowable.task.api.Task) User(bpm.ex1.entity.User) EmailInfo(io.jmix.email.EmailInfo) EventListener(org.springframework.context.event.EventListener)

Aggregations

EventListener (org.springframework.context.event.EventListener)7 User (bpm.ex1.entity.User)5 EmailInfo (io.jmix.email.EmailInfo)5 Repo (cn.xnatural.jpa.Repo)4 User (entity.User)4 Task (org.flowable.task.api.Task)4 Test (org.junit.jupiter.api.Test)4 User (security.ex1.entity.User)3 User (com.example1.entity.User)2 User (com.github.yukihane.hibernateissues.qiita20180224.entity.User)2 User (com.olive.java.start.java8.entity.User)2 Collectors (java.util.stream.Collectors)2 Test (org.junit.Test)2 User (ui.ex1.entity.User)2 Department (CreationalPattern.abstractFactory.demo2.entity.Department)1 User (CreationalPattern.abstractFactory.demo2.entity.User)1 AccessFactory (CreationalPattern.abstractFactory.demo2.factory.AccessFactory)1 IFactory (CreationalPattern.abstractFactory.demo2.factory.IFactory)1 MySQLFactory (CreationalPattern.abstractFactory.demo2.factory.MySQLFactory)1 AccessUser (CreationalPattern.abstractFactory.demo2.sqloperation.AccessUser)1