dto

Different versions of PSQL when using DTO to get DB's names

烈酒焚心 提交于 2019-12-13 04:19:13
问题 I am working on an application, installed on windows OS, that connects to a Sage 50 (Peachtree) accounting software. The connection between the application and Sage is created using ODBC. To create the ODBC connection I am using the PSQL DTO lib to get the list of available databases. I obtained the lib from the PSQL SDK here - https://esd.actian.com/product/Zen_PSQL. I wanted to know if i need to worry about different versions of PSQL when using the DTO for the functionality of getting the

How to combine two request bodies in Angular

人盡茶涼 提交于 2019-12-13 03:59:37
问题 I have two different Tables Customer and Ticket . Here is my first question: Post Method using DTO I've created CustomerDto and TicketDto classes in my backend. What should I change in my Angular? I want to save my Customer with list of Ticket , like on the picture. How can I do this in my frontend? Here is my method in the backend: @Override public Customer save(CustomerDto customerDto) { Customer customer = new Customer(); customer.setName(customerDto.getName()); List<Ticket> tickets = new

DDD: Should a Dto Assembler be a part of Domain Layer?

倖福魔咒の 提交于 2019-12-12 10:55:55
问题 Thanks in advance. I have some Aggregates in the Domain Layer library. Also, some DTO s in a separate library, which is shared between Server and Client side. An Aggregate of an entity is more informative than its DTO . So, in order to convert from DTO to Aggregate , a repository should be accessed by a Dto Assembler . Interfaces of repositories are in Domain Layer . That's why i come to conclusion that DtoAssembler should be a part of DomainLayer . Is this right? 回答1: No, this would be plain

Iterate Though IEnumerable<String> to populate List<DTO> MVC C#

此生再无相见时 提交于 2019-12-12 03:54:52
问题 Can anyone help with a problem i have, im trying to write a method that will return a list of my DTO objects I am getting the user by the usrCode and and the getting a list of their jobCodes in the DB. Then i am getting a list of All Jobs from WCF. I then want to make a new list with the jobDescription attached the DTO as the DB only has userCode and jobCode. What i want is a list of JobDescription from my WCF but from a list of Jobs a user DOESNT have. via this.... List<UserJobsDTO> list =

select multiple new() object in hql query

夙愿已清 提交于 2019-12-12 03:47:06
问题 I have a question about hql language. I'm trying to generate DTO's via hql syntax on my WCF REST application. I have a problem with the second query. What is wrong with it? Is there any other way to reach the same result? This works good. session.CreateQuery(@"select new EntityTypeDTO(t.ID, t.Title, assc.ID) from crmEntityType t left outer join t.Association as assc").List<EntityTypeDTO>(); This does not work. session.CreateQuery(@"select new EntityTypeDTO(t.ID, t.Title, assc.ID, new

Web API - Converting JSON to Complex Object Type (DTO) with inheritance

爷,独闯天下 提交于 2019-12-11 21:26:21
问题 I have the following scenario: public class WidgetBaseDTO { public int WidgetID { get; set; } } public class WidgetTypeA : WidgetBaseDTO { public string SomeProperty1 { get; set; } } public class WidgetTypeB : WidgetBaseDTO { public int SomeProperty2 { get; set; } } and my web service returns the following dashboard object whereas the Widgets collection could be of either type A or B: public class DashboardDTO { public List<WidgetBaseDTO> Widgets { get; set; } } my problem is that although

Hql query using dot´s in the response parameters

▼魔方 西西 提交于 2019-12-11 21:05:12
问题 I am accesing to the database using a Dto with some entities and I want to improve the request without modifing my dto and removing the fetch so hibernate don´t return all the data from all the entities (hibernate is set to lazy), I tried with the next, but it´s not working: StringBuilder hql = new StringBuilder(); hql.append(" select d.id as id, ce.cod as clasification.cod "); hql.append(" from Document d"); hql.append(" join d.clasificacionEntity ce"); The working hql request: StringBuilder

Parent/child model for DTO

只愿长相守 提交于 2019-12-11 17:17:25
问题 I am not sure if this situation would more be related to generics than DTOs , but here it goes: I have a DTO that represents a Person . A Person can have as children other Person (s) or just ResourceLink to those Person (s). This means that the child can be of either of the 2 types: Person (the DTO) or the ResourceLink . What type it would be, is determined through a queryParam and consequently logically through the flow follwed. I want to represent them using just ONE collection object and

Post Method using DTO

二次信任 提交于 2019-12-11 16:38:41
问题 I want to use DTO to communicate with the Angular, but actually it doesn't work. I want to create POST request to add data from my application to the database using Dto model. You can see my errors on the picture: My class Customer: @Entity @Table(name = "customer") public class Customer { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; @Column(name = "name") private String name; @OneToMany private List<Ticket> ticket; ... Class CustomerDto: public class CustomerDto {

What is the best way to Retrieve List from repository interface to DTO list Class

女生的网名这么多〃 提交于 2019-12-11 15:58:29
问题 There is class name DailyElectricity which is in DTO package and it contain max , min, sum , average with getter and setter public class DailyElectricity implements Serializable { private static final long serialVersionUID = 3605549122072628877L; private LocalDate date; private Long sum; private Double average; private Long min; private Long max; } there is interface which its job is to get data from database @RestResource(exported = false) public interface HourlyElectricityRepository extends