首页 \ 问答 \ Java EE数据层框架(Java EE Data layer frameworks)

Java EE数据层框架(Java EE Data layer frameworks)

我试图找出Java EE应用服务器上数据层上使用最广泛的框架。

我想知道哪些在哪里使用,以及它们的优点和缺点。


I am trying to figure out what are the most widely used frameworks on the data layer on a Java EE application server.

I would like help in knowing which are used out there and what are their Pros and Cons.


原文:https://stackoverflow.com/questions/2347881
更新时间:2023-07-11 22:07

最满意答案

我已经在我的代码中实现了完全相同的功能,可以像控制一样复制android ...

请查看我的代码的某些部分,您将获得一些想法

我通过向UIScrollView添加Views来完成它。 使用2个滚动视图,一个用于标题,一个用于表

1.将表视图添加到表的scrollview

pageNo = 1;

for (Page *page in pageArray)
{
    UIStoryboard *mystoryboard = [UIStoryboard storyboardWithName:@"Main_iPhone" bundle:nil];
    PageContentViewController *contentViewController = [mystoryboard instantiateViewControllerWithIdentifier:@"pageContentViewController"];

    contentViewController.detailsDictionary = page.deviceDetailDictionary; //assigning dictionary will use as table data source

    /* Content page's x position calculation */

    // Formula: xPos = scrollViewWidth * ( pageNo -1 )
    // Where,
    // pageNo starts with 1

    int xPos = self.detailScrollView.frame.size.width * (pageNo -1);
    contentViewController.view.frame = CGRectMake(xPos, 0, self.detailScrollView.frame.size.width, contentViewController.view.frame.size.height);
    pageNo ++;

    [self addChildViewController:contentViewController];
    [self.detailScrollView addSubview:contentViewController.view];
    [contentViewController didMoveToParentViewController:self];
}

2.将UILabel添加到titleScrollView

只需检查此公式即可将标题UILabel视图添加到顶部滚动视图

    // Formula: xPos = 75 + 10 * pageNo + (pageNo -1) * 150;
    // Where,
    // pageNo starts with 1
    // 75 = Left margin of first title
    // 10 = Space between two labels
    // 150 = Width of label 

3.使用ScrollView的Delegate方法(在其中添加了表格)来处理滑动

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView;
{
    CGFloat pageWidth = self.detailScrollView.frame.size.width;

    //1. Calculate page no. if 50 percent or more area of any page visible make it as current page
    int pageNo = floor((self.detailScrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 2;

    //2. Make only current page (calculated in 1.) visible by scrolling to that page in detailScrollView
    //Formula : xPos = pageWidth * (pageNo -1)
    CGRect frame = CGRectMake( pageWidth * (pageNo -1), 0, pageWidth, 50);
    [self.detailScrollView scrollRectToVisible:frame animated:YES];//OR set content offset

    //3. Make title visible of current page by scrolling to that title in titleScrollView
    //Formula : xPos = (pageWidth / 2) * (pageNo -1)
    CGRect titleFrame = CGRectMake( 160 * (pageNo -1), 0, pageWidth, 10);
    [self.titleScrollView scrollRectToVisible:titleFrame animated:YES];//OR set content offset

    //Fade effect for non current titles

    //Set all page title alpha to low value
    for (UILabel *title in pageTitleArray)
    {
        [title setAlpha:0.5];
    }

    //set current page alpha to 1
    UILabel *title = [pageTitleArray objectAtIndex:pageNo -1];
    [title setAlpha:1];
}

3中的代码负责在动画滑动时移动到next / prev页面

希望这对你来说是一个很好的起点......


I have implemented exact same in my code which replicates android like control…

Please see some part of my code you will get some ideas

I have done it by adding Views to UIScrollView. Used 2 scrollviews one for title and one for tables

1. Adding table views to scrollview for table

pageNo = 1;

for (Page *page in pageArray)
{
    UIStoryboard *mystoryboard = [UIStoryboard storyboardWithName:@"Main_iPhone" bundle:nil];
    PageContentViewController *contentViewController = [mystoryboard instantiateViewControllerWithIdentifier:@"pageContentViewController"];

    contentViewController.detailsDictionary = page.deviceDetailDictionary; //assigning dictionary will use as table data source

    /* Content page's x position calculation */

    // Formula: xPos = scrollViewWidth * ( pageNo -1 )
    // Where,
    // pageNo starts with 1

    int xPos = self.detailScrollView.frame.size.width * (pageNo -1);
    contentViewController.view.frame = CGRectMake(xPos, 0, self.detailScrollView.frame.size.width, contentViewController.view.frame.size.height);
    pageNo ++;

    [self addChildViewController:contentViewController];
    [self.detailScrollView addSubview:contentViewController.view];
    [contentViewController didMoveToParentViewController:self];
}

2. Add UILabels to titleScrollView

Just check this formula to add title UILabel views to top scroll view

    // Formula: xPos = 75 + 10 * pageNo + (pageNo -1) * 150;
    // Where,
    // pageNo starts with 1
    // 75 = Left margin of first title
    // 10 = Space between two labels
    // 150 = Width of label 

3. Use Delegate method of ScrollView (in which you added table) to handle swipes

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView;
{
    CGFloat pageWidth = self.detailScrollView.frame.size.width;

    //1. Calculate page no. if 50 percent or more area of any page visible make it as current page
    int pageNo = floor((self.detailScrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 2;

    //2. Make only current page (calculated in 1.) visible by scrolling to that page in detailScrollView
    //Formula : xPos = pageWidth * (pageNo -1)
    CGRect frame = CGRectMake( pageWidth * (pageNo -1), 0, pageWidth, 50);
    [self.detailScrollView scrollRectToVisible:frame animated:YES];//OR set content offset

    //3. Make title visible of current page by scrolling to that title in titleScrollView
    //Formula : xPos = (pageWidth / 2) * (pageNo -1)
    CGRect titleFrame = CGRectMake( 160 * (pageNo -1), 0, pageWidth, 10);
    [self.titleScrollView scrollRectToVisible:titleFrame animated:YES];//OR set content offset

    //Fade effect for non current titles

    //Set all page title alpha to low value
    for (UILabel *title in pageTitleArray)
    {
        [title setAlpha:0.5];
    }

    //set current page alpha to 1
    UILabel *title = [pageTitleArray objectAtIndex:pageNo -1];
    [title setAlpha:1];
}

Code in 3 takes care of moving to next / prev page on swipe with animation

Hope this will be good starting point for you...

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)